X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f9b24f070c67c61d11a0032054e0a229d876f38d..a1db4ad4a44c45644d4b4dd6dea701233f01d422:/wxPython/demo/ScrolledPanel.py diff --git a/wxPython/demo/ScrolledPanel.py b/wxPython/demo/ScrolledPanel.py index e4a0bb507d..2ff349b8f3 100644 --- a/wxPython/demo/ScrolledPanel.py +++ b/wxPython/demo/ScrolledPanel.py @@ -10,8 +10,7 @@ class ScrolledPanel(wxScrolledWindow): def __init__(self, parent, log): self.log = log wxScrolledWindow.__init__(self, parent, -1, - style = wxTAB_TRAVERSAL|wxHSCROLL|wxVSCROLL) - + style = wxTAB_TRAVERSAL) box = wxBoxSizer(wxVERTICAL) box.Add(wxStaticText(self, -1, @@ -43,9 +42,10 @@ class ScrolledPanel(wxScrolledWindow): self.EnableScrolling(false, true) self.SetScrollRate(0, 20) box.SetVirtualSizeHints(self) - EVT_CHILD_FOCUS(self, self.OnChildFocus) + wxCallAfter(self.Scroll, 0, 0) # scroll back to top after initial events + def OnChildFocus(self, evt): # If the child window that gets the focus is not visible, @@ -73,10 +73,6 @@ class ScrolledPanel(wxScrolledWindow): #---------------------------------------------------------------------- -## class ScrollToHandler(wxEvtHandler): -## """This class helps to scroll the panel - -#---------------------------------------------------------------------- def runTest(frame, nb, log): win = ScrolledPanel(nb, log)