Akshit Khurana
Akshit Khurana

Reputation: 694

How can I display a Gtk Widget over (inside) a Cairo surface?

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?

Upvotes: 3

Views: 840

Answers (1)

ptomato
ptomato

Reputation: 57870

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.

Upvotes: 2

Related Questions