I'm creating a GUI using wxPython that uses the wx.Notebook widget. Since I removed the labels on the Notebook tabs for design purposes, I would like to add tooltips for each tab individually that show the tab's purpose.
I thought I could use the AddPage() method of the Notebook class. But it only returns bool values, so that I cannot use the SetToolTip() method for either tab.
How would I go about doing that?
This is not something that is built-in to the
wx.Notebookwidget. You could probably do it yourself by binding towx.EVT_MOTIONand checking you mouse's position to determine when to set a tooltip.The
AUINotebookmight be a better choice since it has aTabHitTestmethod. Someone on the wxPython group mentioned a way to add tooltips to it here: http://wxpython-users.1045709.n5.nabble.com/setting-a-tooltip-on-auinotebook-tab-td5548750.htmlHere's the code they ended up using in the mouse over event handler: