質問

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?

役に立ちましたか?

解決

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);
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top