]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/ScrolledPanel.py
Fixed bug in Grow function (possibly not allocating enough memory if starting
[wxWidgets.git] / wxPython / demo / ScrolledPanel.py
index e4a0bb507df63df4c5ce26d48d0928709b74be02..2ff349b8f39e5bc041107ab667140d675fa05b6f 100644 (file)
@@ -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)