example of context sensitive help?

f rom wrote:

Does anyone have an example of context sensitive help?
I'm not clear about this two stage construction
process needed for this. ie after Create what then?

Also I'd like to know which class will receive the
message. I think the context sensitive help should be
put on the frame but the controls themselves are on
the notebook inside the frame. So I hope the messages
will then go to the notebook class.

To setup context-sensitive help, you can call the 'SetTextHelp' method.
For example:

    e = wx.TextCtrl(myPanel,value="")
    e.SetHelpText("In this control, you can type in some text.")

You also need to create a button for opening the context help:

    b = wx.ContextHelpButton(self)
    b.Bind(wx.EVT_BUTTON,self.OnContextHelp)

    def OnContextHelp(self,event):
        """Called when somebody clicks on the context help button."""
        event.Skip()

Finally, you can control the displayed help with help providers.
When your program starts, you can do this:

# Create application
app = wx.PySimpleApp()
# Now we can use wxWindow objects - initialization part
app.helpprovider = wx.SimpleHelpProvider()
wx.HelpProvider_Set(app.helpprovider)

Please note that there are other help providers - browse the docs.

Also please check the wxPython demo (navigate to "More Windows/Controls" in the tree and then select "ContextHelp").

···

--
_________________________________________________________________
  Laszlo Nagy web: http://designasign.biz
  IT Consultant mail: gandalf@geochemsource.com

         Python forever!