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,
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,
#----------------------------------------------------------------------
-## class ScrollToHandler(wxEvtHandler):
-## """This class helps to scroll the panel
-
-#----------------------------------------------------------------------
def runTest(frame, nb, log):
win = ScrolledPanel(nb, log)