[gtk+] testmenubutton: Add a toggle for use-popover
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] testmenubutton: Add a toggle for use-popover
- Date: Tue, 29 Apr 2014 01:56:09 +0000 (UTC)
commit c8e15e43e9009fc0768d5bf893ff58f0f0fdc8a1
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Apr 28 21:53:03 2014 -0400
testmenubutton: Add a toggle for use-popover
tests/testmenubutton.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/tests/testmenubutton.c b/tests/testmenubutton.c
index a48d7ea..6c15176 100644
--- a/tests/testmenubutton.c
+++ b/tests/testmenubutton.c
@@ -39,6 +39,7 @@ int main (int argc, char **argv)
GtkWidget *grid;
GtkWidget *entry;
GtkWidget *label;
+ GtkWidget *check;
GtkWidget *combo;
GtkWidget *menu_widget;
GtkAccelGroup *accel_group;
@@ -132,6 +133,10 @@ int main (int argc, char **argv)
gtk_grid_attach (GTK_GRID (grid), button, 1, row++, 1, 1);
gtk_widget_show (create_prop_editor (G_OBJECT (button), 0));
+ check = gtk_check_button_new_with_label ("Popover");
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE);
+ gtk_grid_attach (GTK_GRID (grid), check, 0, row, 1, 1);
+
/* Button with GMenuModel */
menu = g_menu_new ();
for (i = 5; i > 0; i--) {
@@ -147,6 +152,8 @@ int main (int argc, char **argv)
}
button = gtk_menu_button_new ();
+ g_object_bind_property (check, "active", button, "use-popover", G_BINDING_SYNC_CREATE);
+
gtk_widget_set_halign (button, GTK_ALIGN_START);
menubuttons = g_list_prepend (menubuttons, button);
gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (button), G_MENU_MODEL (menu));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]