[gtk+] applicationwindow: Fix code sample
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] applicationwindow: Fix code sample
- Date: Wed, 11 Oct 2017 10:58:46 +0000 (UTC)
commit 0f8abcd112664b26aeb8170b970654d889762026
Author: Timm Bäder <mail baedert org>
Date: Wed Oct 11 12:41:47 2017 +0200
applicationwindow: Fix code sample
Declare all variables, use proper GtkApplication constructor and the
right GTK_APPLICATION() cast for gtk_application* API.
gtk/gtkapplicationwindow.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkapplicationwindow.c b/gtk/gtkapplicationwindow.c
index 9c028a2..2a33ceb 100644
--- a/gtk/gtkapplicationwindow.c
+++ b/gtk/gtkapplicationwindow.c
@@ -79,9 +79,9 @@
* ## A GtkApplicationWindow with a menubar
*
* |[<!-- 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>"
* " <menu id='menubar'>"
* " <submenu label='_Edit'>"
@@ -92,14 +92,14 @@
* "</interface>",
* -1);
*
- * menubar = G_MENU_MODEL (gtk_builder_get_object (builder,
- * "menubar"));
- * gtk_application_set_menubar (G_APPLICATION (app), menubar);
+ * GMenuModel *menubar = G_MENU_MODEL (gtk_builder_get_object (builder,
+ * "menubar"));
+ * gtk_application_set_menubar (GTK_APPLICATION (app), menubar);
* g_object_unref (builder);
*
- * ...
+ * // ...
*
- * window = gtk_application_window_new (app);
+ * GtkWidget *window = gtk_application_window_new (app);
* ]|
*
* ## Handling fallback yourself
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]