[gtk+] infobar demo: Adapt to GtkInfoBar changes
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] infobar demo: Adapt to GtkInfoBar changes
- Date: Thu, 12 Jan 2017 17:41:07 +0000 (UTC)
commit 58c252d5e6640c3f8c3e8bdf0b97f967b26b1728
Author: Timm Bäder <mail baedert org>
Date: Thu Jan 12 09:10:02 2017 +0100
infobar demo: Adapt to GtkInfoBar changes
Bind GtkToggleButton:active to GtkInfoBar:revealed instead of :visible.
demos/gtk-demo/infobar.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/demos/gtk-demo/infobar.c b/demos/gtk-demo/infobar.c
index f58d57e..3e6d088 100644
--- a/demos/gtk-demo/infobar.c
+++ b/demos/gtk-demo/infobar.c
@@ -16,7 +16,7 @@ on_bar_response (GtkInfoBar *info_bar,
if (response_id == GTK_RESPONSE_CLOSE)
{
- gtk_widget_hide (GTK_WIDGET (info_bar));
+ gtk_info_bar_set_revealed (info_bar, FALSE);
return;
}
@@ -73,7 +73,7 @@ do_infobar (GtkWidget *do_widget)
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE);
button = gtk_toggle_button_new_with_label ("Message");
- g_object_bind_property (button, "active", bar, "visible", G_BINDING_BIDIRECTIONAL);
+ g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL |
G_BINDING_SYNC_CREATE);
gtk_container_add (GTK_CONTAINER (actions), button);
bar = gtk_info_bar_new ();
@@ -85,7 +85,7 @@ do_infobar (GtkWidget *do_widget)
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE);
button = gtk_toggle_button_new_with_label ("Warning");
- g_object_bind_property (button, "active", bar, "visible", G_BINDING_BIDIRECTIONAL);
+ g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL |
G_BINDING_SYNC_CREATE);
gtk_container_add (GTK_CONTAINER (actions), button);
bar = gtk_info_bar_new_with_buttons (_("_OK"), GTK_RESPONSE_OK, NULL);
@@ -99,7 +99,7 @@ do_infobar (GtkWidget *do_widget)
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE);
button = gtk_toggle_button_new_with_label ("Question");
- g_object_bind_property (button, "active", bar, "visible", G_BINDING_BIDIRECTIONAL);
+ g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL |
G_BINDING_SYNC_CREATE);
gtk_container_add (GTK_CONTAINER (actions), button);
bar = gtk_info_bar_new ();
@@ -111,7 +111,8 @@ do_infobar (GtkWidget *do_widget)
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE);
button = gtk_toggle_button_new_with_label ("Error");
- g_object_bind_property (button, "active", bar, "visible", G_BINDING_BIDIRECTIONAL);
+ g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL |
G_BINDING_SYNC_CREATE);
+
gtk_container_add (GTK_CONTAINER (actions), button);
bar = gtk_info_bar_new ();
@@ -123,7 +124,7 @@ do_infobar (GtkWidget *do_widget)
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE);
button = gtk_toggle_button_new_with_label ("Other");
- g_object_bind_property (button, "active", bar, "visible", G_BINDING_BIDIRECTIONAL);
+ g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL |
G_BINDING_SYNC_CREATE);
gtk_container_add (GTK_CONTAINER (actions), button);
frame = gtk_frame_new ("Info bars");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]