Hi,
I've noted that wx.lib.scrolledpanel ( very nice object!! ) don't works properly.
If I add some objects into scrolled panel, and, on button click, I want scroll at the end of scrolled panel, It doesn't works!!
Anyone can tell me why?
I've noted that wx.lib.scrolledpanel ( very nice object!! ) don't works
properly.
If I add some objects into scrolled panel, and, on button click, I want
scroll at the end of scrolled panel, It doesn't works!!
Anyone can tell me why?
In which sense "it doesn't work"? How are you trying to scroll at the
end? Can you show some simple code that reproduces the problem you are
having?
self.box is a BoxSizer(wx.VERTICAL), SELF is refered to a class
MyClass(wx.lib.scrolledPanel.ScrolledPanel) and Bordo is a
normal wx.Panel class
Naturally, after added new object, I would like scroll to last position, but
self.ScrollChildIntoView(b) doesn't works, and self.Scroll(0, 1000) doesn't
works too.
Uhm, I can only guess what's happening as your code can not be run as
it is... have you tried using something like:
wx.CallAfter(self.ScrollChildIntoView, b)
Or:
wx.CallLater(100, self.ScrollChildIntoView, b)
? Otherwise, please try to create a small runnable sample that
reproduces the problem.
self.box is a BoxSizer(wx.VERTICAL), SELF is refered to a class MyClass(wx.lib.scrolledPanel.ScrolledPanel) and Bordo is a normal wx.Panel class
Naturally, after added new object, I would like scroll to last position, but
self.ScrollChildIntoView(b) doesn't works, and self.Scroll(0, 1000) doesn't works too.
I don't know why....
SetupScrolling will scroll to the top when it is done. That was formerly a side-effect of its implementation, but starting in 2.8.8.1 it is a default but optional behavior. You can pass scrollToTop=False to avoid scrolling.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
Are you forgetting to call self.FitInside(), which forces the sizer to
set the scrolled window's virtual size, which is what triggers the
scrollbars to be shown? This works for me.
TomH
···
On Thu, Aug 21, 2008 at 5:20 PM, Robin Dunn <robin@alldunn.com> wrote:
Mariano Di Felice wrote:
Sure Andrea,
I have some object into scrolled panel, and all it's ok!
When I click a button, I want insert another object into scrolled panel:
self.box is a BoxSizer(wx.VERTICAL), SELF is refered to a class
MyClass(wx.lib.scrolledPanel.ScrolledPanel) and Bordo is a normal wx.Panel
class
Naturally, after added new object, I would like scroll to last position,
but
self.ScrollChildIntoView(b) doesn't works, and self.Scroll(0, 1000)
doesn't works too.
I don't know why....
SetupScrolling will scroll to the top when it is done. That was formerly a
side-effect of its implementation, but starting in 2.8.8.1 it is a default
but optional behavior. You can pass scrollToTop=False to avoid scrolling.
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!