質問

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?

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top