[gtk: 2/3] gtk-demo: InfoBar is not a GtkBox anymore



commit a02c588b191bbaa944767e4751877275b8e4e0c3
Author: Alexander Larsson <alexl redhat com>
Date:   Wed May 13 11:04:49 2020 +0200

    gtk-demo: InfoBar is not a GtkBox anymore
    
    Use gtk_info_bar_add_child to add children

 demos/gtk-demo/infobar.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/demos/gtk-demo/infobar.c b/demos/gtk-demo/infobar.c
index 786babbec6..3d12b26141 100644
--- a/demos/gtk-demo/infobar.c
+++ b/demos/gtk-demo/infobar.c
@@ -71,7 +71,7 @@ do_infobar (GtkWidget *do_widget)
       label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_INFO");
       gtk_label_set_wrap (GTK_LABEL (label), TRUE);
       gtk_label_set_xalign (GTK_LABEL (label), 0);
-      gtk_box_append (GTK_BOX (bar), label);
+      gtk_info_bar_add_child (GTK_INFO_BAR (bar), label);
 
       button = gtk_toggle_button_new_with_label ("Message");
       g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL | 
G_BINDING_SYNC_CREATE);
@@ -83,7 +83,7 @@ do_infobar (GtkWidget *do_widget)
       label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_WARNING");
       gtk_label_set_wrap (GTK_LABEL (label), TRUE);
       gtk_label_set_xalign (GTK_LABEL (label), 0);
-      gtk_box_append (GTK_BOX (bar), label);
+      gtk_info_bar_add_child (GTK_INFO_BAR (bar), label);
 
       button = gtk_toggle_button_new_with_label ("Warning");
       g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL | 
G_BINDING_SYNC_CREATE);
@@ -97,7 +97,7 @@ do_infobar (GtkWidget *do_widget)
       label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_QUESTION");
       gtk_label_set_wrap (GTK_LABEL (label), TRUE);
       gtk_label_set_xalign (GTK_LABEL (label), 0);
-      gtk_box_append (GTK_BOX (bar), label);
+      gtk_info_bar_add_child (GTK_INFO_BAR (bar), label);
       gtk_info_bar_set_default_response (GTK_INFO_BAR (bar), GTK_RESPONSE_OK);
 
       button = gtk_toggle_button_new_with_label ("Question");
@@ -110,7 +110,7 @@ do_infobar (GtkWidget *do_widget)
       label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_ERROR");
       gtk_label_set_wrap (GTK_LABEL (label), TRUE);
       gtk_label_set_xalign (GTK_LABEL (label), 0);
-      gtk_box_append (GTK_BOX (bar), label);
+      gtk_info_bar_add_child (GTK_INFO_BAR (bar), label);
 
       button = gtk_toggle_button_new_with_label ("Error");
       g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL | 
G_BINDING_SYNC_CREATE);
@@ -123,7 +123,7 @@ do_infobar (GtkWidget *do_widget)
       label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_OTHER");
       gtk_label_set_wrap (GTK_LABEL (label), TRUE);
       gtk_label_set_xalign (GTK_LABEL (label), 0);
-      gtk_box_append (GTK_BOX (bar), label);
+      gtk_info_bar_add_child (GTK_INFO_BAR (bar), label);
 
       button = gtk_toggle_button_new_with_label ("Other");
       g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL | 
G_BINDING_SYNC_CREATE);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]