Scroll to the end (right) in wx.ScrolledPanel
I add dynamically images to wx.ScrolledPanel. I add them sizer which is inside ScrolledPanel. I want to scroll ScrollBar automat开发者_JAVA技巧ically to the end.
It is possible?
I've read that:
self.scroll.SetupScrolling(scroll_x=True, scroll_y=False, scrollToTop=False)
Can resolve this problem, but in my application it doesn't work.
Scrolled Panel definition:
self.scroll = scrolled.ScrolledPanel(self, id = -1, pos = wx.DefaultPosition, size = (510, 200), style = wx.SUNKEN_BORDER)
self.sizer.Add(self.scroll)
Add elements to them:
self.scroll.SetSizer(self.hbox )
self.scroll.SetAutoLayout(1)
self.scroll.SetupScrolling(scrollToTop=False)
self.scroll.FitInside()
self.SetSizerAndFit(self.sizer)
self.Refresh()
self.Layout()
Scroll automatically return to the left (begin of my image's list).. Anyone help?
self.Scroll(self.GetClientSize()[0], -1)
clientSize is a tuple (x, y) of the widget's size and -1 specifies to not make any changes across the Y direction.
精彩评论