applicationwindow: Fix code sample
Declare all variables, use proper GtkApplication constructor and the right GTK_APPLICATION() cast for gtk_application* API.
This commit is contained in:
parent
a54550db7b
commit
413d548edd
@ -79,9 +79,9 @@
|
|||||||
* ## A GtkApplicationWindow with a menubar
|
* ## A GtkApplicationWindow with a menubar
|
||||||
*
|
*
|
||||||
* |[<!-- language="C" -->
|
* |[<!-- language="C" -->
|
||||||
* app = gtk_application_new ();
|
* GtkApplication *app = gtk_application_new ("org.gtk.test", 0);
|
||||||
*
|
*
|
||||||
* builder = gtk_builder_new_from_string (
|
* GtkBuilder *builder = gtk_builder_new_from_string (
|
||||||
* "<interface>"
|
* "<interface>"
|
||||||
* " <menu id='menubar'>"
|
* " <menu id='menubar'>"
|
||||||
* " <submenu label='_Edit'>"
|
* " <submenu label='_Edit'>"
|
||||||
@ -92,14 +92,14 @@
|
|||||||
* "</interface>",
|
* "</interface>",
|
||||||
* -1);
|
* -1);
|
||||||
*
|
*
|
||||||
* menubar = G_MENU_MODEL (gtk_builder_get_object (builder,
|
* GMenuModel *menubar = G_MENU_MODEL (gtk_builder_get_object (builder,
|
||||||
* "menubar"));
|
* "menubar"));
|
||||||
* gtk_application_set_menubar (G_APPLICATION (app), menubar);
|
* gtk_application_set_menubar (GTK_APPLICATION (app), menubar);
|
||||||
* g_object_unref (builder);
|
* g_object_unref (builder);
|
||||||
*
|
*
|
||||||
* ...
|
* // ...
|
||||||
*
|
*
|
||||||
* window = gtk_application_window_new (app);
|
* GtkWidget *window = gtk_application_window_new (app);
|
||||||
* ]|
|
* ]|
|
||||||
*
|
*
|
||||||
* ## Handling fallback yourself
|
* ## Handling fallback yourself
|
||||||
|
Loading…
Reference in New Issue
Block a user