More demo tweaks and fixes

This commit is contained in:
Robin Dunn
2016-07-30 23:45:22 -07:00
parent b328b91d59
commit aa9e47e0f5
6 changed files with 45 additions and 32 deletions

View File

@@ -25,6 +25,7 @@ class TestPanel(wx.Panel):
# Init the context help button.
# And even include help text about the help button :-)
cBtn = wx.ContextHelpButton(self)
cBtn.Bind(wx.EVT_BUTTON, self.OnCtxHelpButton)
cBtn.SetHelpText("wx.ContextHelpButton")
cBtnText = wx.StaticText(self, -1,
@@ -63,7 +64,6 @@ class TestPanel(wx.Panel):
sizer.Add(text)
text.Bind(wx.EVT_HELP, self.OnCtxHelp2, text)
border = wx.BoxSizer(wx.VERTICAL)
border.Add(sizer, 0, wx.ALL, 25)
@@ -72,9 +72,16 @@ class TestPanel(wx.Panel):
self.Layout()
def OnCtxHelpButton(self, evt):
# This starts a nested event loop which exits when an item has been
# clicked on, its help message shown and dismissed.
cshelp = wx.ContextHelp(self)
# On the second text control above, we intercept the help event. This is where
# we process it. Anything could happen here. In this case we're just printing
# some stuff about it, then passing it on, at which point we see the help tip.
# some stuff about it, then passing it on with Skip(), at which point we
# see the help tip.
def OnCtxHelp(self, evt):
self.log.write("OnCtxHelp: %s" % evt)
evt.Skip()