Overlay Toolbar / GTK Widget

I am writing a special C application using GTK + 2.0 and Cairo. Just for training purposes (and, if possible, and then for deployment), I want to recreate something similar to a toolbar / overlay widget (I'm sorry if the terminology is incorrect), which appears when the mouse moves over a given area in the window and disappears when the mouse leaves. The toolbar, I believe, should appear on top of existing widgets without moving them or changing the packaging of the widgets. Can this be done? If so, can you point me to the relevant tutorials / examples and / or outline a way to do the same? Thanks in advance.

+4
source share
2 answers

Not sure if this is easily doable in GTK2. However, I recently found out that there is a GtkLayout widget that allows you to pixelize widgets, so you can even display some widgets over others. Or you can implement your own container widget.

Note that with GTK3 there is GtkOverlay, which seems to do what you want.

You can also take a look at Clutter, which may allow this. In addition, there are GTK and Clutter merger projects for GTK 4.

+6
source

The little-known GtkHandleBox is capable of doing what you want. I must warn you that it is deprecated in GTK + 3 because it goes against the usual direction of the user interface. Also, proper positioning will be tied to the oddities of the window manager, so I expect some problem in this regard.

+2
source

All Articles