467,132 Members | 1,157 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,132 developers. It's quick & easy.

wxGrid Synchronising Scroll Bars

Hello,

I have a problem : (

I have two grids both of which have scrollbars which as i understand it, are automatically handled by wxGrid.

What i need is to bind the scrollbars so when one is moved to a certain position the other one should move there too.

So i'm guessing it needs to be something like this -
Expand|Select|Wrap|Line Numbers
  1.     EVT_SCROLL(self.grid, self.OnScroll()) #self.grid is one grid and self.plan is the other
  2.  
  3.     def OnScroll(self):
  4.             x, y = #NEED A WAY OF GETTING THE X,Y POSITION OF THE SCROLL BAR
  5.             self.plan.Scroll(x, y)
  6.             self.plan.AdjustScrollbars()
  7.  
  8. #HAVE A SIMILAR THING FOR THE OTHER SCROLL BAR
  9.  
I don't know how to get the x and y position.

Any suggestions?

Many thanks,

Ayesha
Mar 15 '07 #1
  • viewed: 1975
Share:
2 Replies
bartonc
Expert 4TB
Hello,

I have a problem : (

I have two grids both of which have scrollbars which as i understand it, are automatically handled by wxGrid.

What i need is to bind the scrollbars so when one is moved to a certain position the other one should move there too.

So i'm guessing it needs to be something like this -
Expand|Select|Wrap|Line Numbers
  1.     EVT_SCROLL(self.grid, self.OnScroll()) #self.grid is one grid and self.plan is the other
  2.  
  3.     def OnScroll(self):
  4.             x, y = #NEED A WAY OF GETTING THE X,Y POSITION OF THE SCROLL BAR
  5.             self.plan.Scroll(x, y)
  6.             self.plan.AdjustScrollbars()
  7.  
  8. #HAVE A SIMILAR THING FOR THE OTHER SCROLL BAR
  9.  
I don't know how to get the x and y position.

Any suggestions?

Many thanks,

Ayesha
Check the docs for wxScrollEvent. You get the orientation and the positions separately from the event.
Mar 15 '07 #2
bartonc
Expert 4TB
Check the docs for wxScrollEvent. You get the orientation and the positions separately from the event.
I'll post my way of communicating between two widgets on the same frame/panel when you reply.
Mar 16 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

12 posts views Thread by Arlie Rahn | last post: by
3 posts views Thread by Tim Williams | last post: by
reply views Thread by syed_saqib_ali@yahoo.com | last post: by
reply views Thread by Eric | last post: by
2 posts views Thread by usenet@isbd.co.uk | last post: by
1 post views Thread by David_from_Chicago | last post: by
6 posts views Thread by bgold12 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.