From fede7cd81c623a2a18e7a77fa0f21b23e10e00d6 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Wed, 13 May 2020 10:50:41 +0200 Subject: [PATCH 1/2] gtk-demo: Fix expander demo GtkExpander is not a GtkBox anymore, so use the new gtk_expander_set_child() API. --- demos/gtk-demo/expander.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/gtk-demo/expander.c b/demos/gtk-demo/expander.c index 46ccff1833..6d4583dbff 100644 --- a/demos/gtk-demo/expander.c +++ b/demos/gtk-demo/expander.c @@ -79,7 +79,7 @@ do_expander (GtkWidget *do_widget) "innuendo, just to make you scroll down or " "resize the window. Do it already !", -1); gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), tv); - gtk_box_append (GTK_BOX (expander), sw); + gtk_expander_set_child (GTK_EXPANDER (expander), sw); gtk_box_append (GTK_BOX (area), expander); g_signal_connect (expander, "notify::expanded", G_CALLBACK (expander_cb), window); From a02c588b191bbaa944767e4751877275b8e4e0c3 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Wed, 13 May 2020 11:04:49 +0200 Subject: [PATCH 2/2] 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);