X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3115ef3e56082b961af85a06955b50ddf0c5738a..d3a80c922c7f0932f0b3985846e58ef48e3a6da7:/wxPython/demo/ScrolledPanel.py?ds=sidebyside diff --git a/wxPython/demo/ScrolledPanel.py b/wxPython/demo/ScrolledPanel.py index bd54d5bf29..2ff349b8f3 100644 --- a/wxPython/demo/ScrolledPanel.py +++ b/wxPython/demo/ScrolledPanel.py @@ -42,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,