GTK Tooltips On Notebook Tab Labels

August 22, 2007

Here’s a non-obvious (or to me at least) trick to get tooltips onto a Gtk::Notebook tab. It took some searching, but essentially, you just add the Gtk::Label to a Gtk::EventBox and add that to the tab instead. Then you attach the tool tip to the Gtk::EventBox instead of the Gtk::Label.

Here’s an example. I couldn’t get my example to compile, the linker was going crazy, but I’m 99% sure that it’s fine. I’m probably just not seeing one glaring error. Let me know if you find it. The important stuff is all there, even if it won’t build.

main.cpp

nbtt.cpp

nbtt.h

I found this trick in the [email protected] history. The thread starts here if you want to read the exchange.

Categories: Geek
Tags: , , ,

Leave A Comment

Your email will not be published.