I found that ScrollPanel automatically scorlls after it regain the focus.
I write a script to help you undertand what I mean. just run
scrpanl.py, and resize the frame to make the vertical scrollbar
appear, then drag the scrollbar to move to the other side, then click
the button, finally click anywhere of the scrollpanel(the blue area),
and you'll see that the scrollpanel automatically scrolls!
I have tried something like this:
def OnButton():
...
x, y =self.scrollPanel_.GetViewStart()
self.scrollPanel_.SetFocus()
self.scrollPanel_.Scroll(x, y)
...
But this still can not make the scrollpanel go back to the place exactly,
Could anybody tell me how to make it not automatically scroll? Thanks
in advance.
I found that ScrollPanel automatically scorlls after it regain the focus.
I write a script to help you undertand what I mean. just run
scrpanl.py, and resize the frame to make the vertical scrollbar
appear, then drag the scrollbar to move to the other side, then click
the button, finally click anywhere of the scrollpanel(the blue area),
and you'll see that the scrollpanel automatically scrolls!
Take a look at wx/lib/scrolledpanel.py and you'll see that it is catching the EVT_CHILD_FOCUS event and then scrolling enough to make the child visible. If you want to change that then just catch EVT_CHILD_FOCUS yourself and do something differently.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
Bruce Who wrote:
> Hi, all
>
> I found that ScrollPanel automatically scorlls after it regain the focus.
>
> I write a script to help you undertand what I mean. just run
> scrpanl.py, and resize the frame to make the vertical scrollbar
> appear, then drag the scrollbar to move to the other side, then click
> the button, finally click anywhere of the scrollpanel(the blue area),
> and you'll see that the scrollpanel automatically scrolls!
>
Take a look at wx/lib/scrolledpanel.py and you'll see that it is
catching the EVT_CHILD_FOCUS event and then scrolling enough to make the
child visible. If you want to change that then just catch
EVT_CHILD_FOCUS yourself and do something differently.
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org