Search code examples
cgtksdlsdl-2

How to put buttons on GtkDrawingArea?


I'm using GTK+ 2.0 and SDL 2 and I need GtkDrawingArea to render SDL on my GTK window. And I use GtkFixed to put GtkDrawingArea on my window.

However, when I try to put a GtkButton using GtkFixed, I can't see any buttons on my drawing area. Is there any example code that can solve this problem?


Solution

  • I'm afraid you can't place widgets on top of other widgets using GTK+ 2.0.

    You could use GtkOverlay if you were using GTK+ 3.0 or GTK+ 4.0 but I can't find something like this in older version.

    (And BTW, I'd advise to take the time and understand GtkBox, GtkTable and GtkLayout. GtkFixed is a pain to work with in longer perspective)