]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/ContextHelp.py
The great wxVScrolledWindow refactoring: allow using it both horizontal and
[wxWidgets.git] / wxPython / demo / ContextHelp.py
index 526a884c83394871833c3c3b9a097dcd927ea1ae..0367a5b84ecfcb9428ec11f22e7f6692ee3dfdc4 100644 (file)
@@ -54,14 +54,14 @@ class TestPanel(wx.Panel):
         text.SetHelpText("Yet another context help message.")
         sizer.Add((20,20))
         sizer.Add(text)
-        self.Bind(wx.EVT_HELP, self.OnCtxHelp, text)
+        text.Bind(wx.EVT_HELP, self.OnCtxHelp, text)
 
         text = wx.TextCtrl(self, -1, "This one displays the tip itself...",
                            size=(240, 60), style = wx.TE_MULTILINE)
         sizer.Add((20,20))
         sizer.Add(text)
-        self.Bind(wx.EVT_HELP, self.OnCtxHelp2, text)
-
+        text.Bind(wx.EVT_HELP, self.OnCtxHelp2, text)
+        
 
         border = wx.BoxSizer(wx.VERTICAL)
         border.Add(sizer, 0, wx.ALL, 25)
@@ -82,24 +82,15 @@ class TestPanel(wx.Panel):
     # Here, we print a note about it, generate our own tip window, and, 
     # unlike last time, we don't pass it on to the underlying provider.
     def OnCtxHelp2(self, evt):
-         self.log.write("OnCtxHelp: %s\n" % evt)
+         self.log.write("OnCtxHelp2: %s\n" % evt)
          tip = wx.TipWindow(self, "This is a wx.TipWindow")
 
 
 #----------------------------------------------------------------------
 
 def runTest(frame, nb, log):
-    if wx.Platform == "__WXMAC__":
-        dlg = wx.MessageDialog(
-                frame, 'The ContextHelp sample does not currently work well on this platform.',
-                'Sorry', wx.OK | wx.ICON_INFORMATION
-                )
-        dlg.ShowModal()
-        dlg.Destroy()
-        
-    else:
-        win = TestPanel(nb, log)
-        return win
+    win = TestPanel(nb, log)
+    return win
 
 
 #----------------------------------------------------------------------
@@ -116,5 +107,5 @@ help into your application using the wx.SimpleHelpProvider class.
 if __name__ == '__main__':
     import sys,os
     import run
-    run.main(['', os.path.basename(sys.argv[0])])
+    run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])