Providing extra tips on usage
ToolTips are small, transient pop-up windows that are automatically displayed when the mouse cursor is hovered over a window. These popups can be used to provide context-sensitive help messages about what changing the state of a control might do or what a field in a dialog is for. Nearly every control type can have a ToolTip associated with it. This recipe shows how to add ToolTip text to windows in your application.
How to do it…
First, let's define a
Panel
subclass with some controls on it through the following code:class MyPanel(wx.Panel): def __init__(self, parent): super(MyPanel, self).__init__(parent) self._timer = wx.Timer(self) self._countDown = 10 self._msg = wx.StaticText(self, label="") self._go = wx.Button(self, label="Go") tip = "Start a countdown to exit the application." self._go.ToolTipString = tip self._stop = wx.Button(self, label="Stop") self._stop.Enable(False...