summaryrefslogtreecommitdiff
path: root/gtk/gtkinfobar.c
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2018-01-03 17:10:21 +0100
committerTimm Bäder <mail@baedert.org>2018-01-03 17:11:32 +0100
commit3f68475b6fa7afede6a929126ddf439498e6d53d (patch)
tree2fc5a880c2d63da491eaaefa85ce3f08108be5e5 /gtk/gtkinfobar.c
parent5cd138f0f2812c7f7e1f31a29b640446f87a0caa (diff)
downloadgtk+-3f68475b6fa7afede6a929126ddf439498e6d53d.tar.gz
Make a few more code samples compile
Diffstat (limited to 'gtk/gtkinfobar.c')
-rw-r--r--gtk/gtkinfobar.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gtk/gtkinfobar.c b/gtk/gtkinfobar.c
index b5ea64354e..11170b241a 100644
--- a/gtk/gtkinfobar.c
+++ b/gtk/gtkinfobar.c
@@ -73,17 +73,18 @@
* by using gtk_info_bar_set_message_type(). GTK+ may use the message type
* to determine how the message is displayed.
*
- * A simple example for using a GtkInfoBar:
+ * A simple example for using a #GtkInfoBar:
* |[<!-- language="C" -->
- * // set up info bar
- * GtkWidget *widget;
+ * GtkWidget *widget, *message_label, *content_area;
+ * GtkWidget *grid;
* GtkInfoBar *bar;
*
+ * // set up info bar
* widget = gtk_info_bar_new ();
* bar = GTK_INFO_BAR (widget);
+ * grid = gtk_grid_new ();
*
* message_label = gtk_label_new ("");
- * gtk_widget_show (message_label);
* content_area = gtk_info_bar_get_content_area (bar);
* gtk_container_add (GTK_CONTAINER (content_area),
* message_label);
@@ -98,10 +99,10 @@
* widget,
* 0, 2, 1, 1);
*
- * ...
+ * // ...
*
* // show an error message
- * gtk_label_set_text (GTK_LABEL (message_label), message);
+ * gtk_label_set_text (GTK_LABEL (message_label), "An error occurred!");
* gtk_info_bar_set_message_type (bar,
* GTK_MESSAGE_ERROR);
* gtk_widget_show (bar);