Question

I have a GTK widget named Cloud (which basically subclasses Gtk.Eventbox) as a Cairo surface painted with a SVG. I'm trying to display other Gtk widgets (Label/Buttons) over it.

I tried adding Gtk.Label elements to the Cloud but they are not shown over the surface.

Using Gtk.Fixed and to position the Cloud under the label doesn't work either.

How do I draw a Gtk widget on a Cairo surface?

Was it helpful?

Solution

I don't know what a Cloud GTK widget is; but more generally, you can use a Gtk.Overlay. add() the cloud widget as its main child, then add_overlay() the other widgets.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top