Search code examples
python-3.xwxwidgets

Python - can you add a tooltip on a wx.CheckBox object?


And if so, how would one add a tooltip to a checkbox object? It appears that the control inherits from wxWindow which has tooltips, so can it be added to a wxCheckBox?

Thanks!


Solution

  • Ok, this is what I did to solve the issue. I needed to bind the mouse over event to the tooltip.

    self.ignCB = wx.CheckBox(self, 0, label='Ignore Errors')
    self.ignCB.Bind(wx.EVT_MOTION, self.on_mouse_over)
    def on_mouse_over(self, event):
                self.ignCB.SetToolTipString('Continue on Download Errors,    Skips Unavailable Videos within a Playlist')
    

    I first create the CheckBox with the label Ignore Errors. Then, I needed to bind the mouse over event to the control, and call the mouse over handler which shows the tool tip.

    Hopefully this will help someone else out as well.