atom feed6 messages in com.googlegroups.wxpython-usersRe: [wxPython] synchronize two scroll...
FromSent OnAttachments
alienoidMar 12, 2002 10:47 pm 
Jan FinellMar 13, 2002 12:37 am 
Richard CooperMar 13, 2002 3:57 am 
Magnus LyckåMar 13, 2002 6:05 am 
Robin DunnMar 13, 2002 10:17 am 
Robin DunnMar 13, 2002 10:22 am 
Subject:Re: [wxPython] synchronize two scrollbars
From:Robin Dunn ("ro.@alldunn.com)
Date:Mar 13, 2002 10:22:40 am
List:com.googlegroups.wxpython-users

How is the easiest way to synchronize two scrollbars? I have two wxGrid, and the horizontal scrollbars of these have to be synchronized.

What I tried to do was to bind EVT_SCROLLWIN to both of them and then using event.GetPosition() to get the position of the actually scrolled one, and then use grid2.SetScrollPos(pos) to set the scrollbar of the other grid. This do change the position of the second scrollbar, BUT the problem is that the second grid is not updated. I've tried to call grid2.Refresh() and grid2.ForceRefresh(), but it doesn't help.

You may want to try something like this instead:

x, y = grid1.GetViewStart() grid2.Scroll(x, y) grid2.AdjustScrollbars()