Question

It would be useful to me to have access to a GtkApplicationWindow object from my code, but I want to use Glade to initialise its properties.

How can I create a GtkApplicationWindow widget in Glade?

Was it helpful?

Solution

In your ui xml change

<object class="GtkWindow" id="foo">

to

<object class="GtkApplicationWindow" id="foo">

and after retrieving the window via gtk builder set the application property:

GTK_WINDOW (gtk_builder_get_object (xml, "foo"));
g_object_set(main_window, "application", application, NULL);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top