diff options
author | Timm Bäder <mail@baedert.org> | 2018-01-03 17:10:21 +0100 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2018-01-03 17:11:32 +0100 |
commit | 3f68475b6fa7afede6a929126ddf439498e6d53d (patch) | |
tree | 2fc5a880c2d63da491eaaefa85ce3f08108be5e5 /gtk/gtkinfobar.c | |
parent | 5cd138f0f2812c7f7e1f31a29b640446f87a0caa (diff) | |
download | gtk+-3f68475b6fa7afede6a929126ddf439498e6d53d.tar.gz |
Make a few more code samples compile
Diffstat (limited to 'gtk/gtkinfobar.c')
-rw-r--r-- | gtk/gtkinfobar.c | 13 |
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); |