I'm trying to use SetScrollPos to move the scrollbar where I want.
Whenever I do this the scrollbar moves to the desired location, but the
window is not actually scrolled. I'm guessing that SetScrollPos doesn't
send an event to let my window know to update it's contents. However,
I'm not sure how to go about fixing this. Please see my attached sample.
You can use the buttons for getting/setting the scrollbar. Any help is
appreciated.
I'm trying to use SetScrollPos to move the scrollbar where I want.
Whenever I do this the scrollbar moves to the desired location, but the
window is not actually scrolled. I'm guessing that SetScrollPos doesn't
send an event to let my window know to update it's contents. However,
I'm not sure how to go about fixing this. Please see my attached sample.
You can use the buttons for getting/setting the scrollbar. Any help is
appreciated.
The scrollbars used internally by the native widgets are an "implementation detail" and only the widget itself has complete access to it and knows how it wants to interact with it. As you've seen using the basic scrolling methods in wx.Window may or may not work with the native controls.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
Thanks Robin,
In my sample I was using a textctrl to build something quick, but my
real app uses CustomTreeCtrl. Thus I have the methods available from
wx.ScrolledWindow. I am able to call x, y = self.tree.GetViewStart() to
get the current xy for the upper left corner of my tree, then call
self.tree.Scroll(x, y) to scroll to the desired location. This works
nicely to have my tree remember its' state between sessions.
I just get a list of what items are selected and/or expanded and the
current xy for scrolling and pickle it. Then I'm able to unpickle it and
recreate the previous state. Works great. Thanks for your help.
-Kyle Rickey
···
-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Friday, January 04, 2008 3:24 PM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] SetScrollPos
Rickey, Kyle W wrote:
I'm trying to use SetScrollPos to move the scrollbar where I want.
Whenever I do this the scrollbar moves to the desired location, but
the
window is not actually scrolled. I'm guessing that SetScrollPos
doesn't
send an event to let my window know to update it's contents. However,
I'm not sure how to go about fixing this. Please see my attached
sample.
You can use the buttons for getting/setting the scrollbar. Any help is
appreciated.
The scrollbars used internally by the native widgets are an
"implementation detail" and only the widget itself has complete access
to it and knows how it wants to interact with it. As you've seen using
the basic scrolling methods in wx.Window may or may not work with the
native controls.
--
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