From 7a75b89efe84460f72876ae58f5b7ef295ddc1cc Mon Sep 17 00:00:00 2001 From: Daniel Boles Date: Sun, 8 Apr 2018 18:39:59 +0100 Subject: [PATCH] testmodelbutton: Test :centered, :icon, :inverted Test more stuff. --- tests/testmodelbutton.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/testmodelbutton.c b/tests/testmodelbutton.c index 1e656e548b..ed6163fadb 100644 --- a/tests/testmodelbutton.c +++ b/tests/testmodelbutton.c @@ -20,6 +20,7 @@ on_application_activate (GApplication *gapplication, GSimpleAction *action; GtkWidget *box; + GIcon *gicon; GtkWidget *model_button; GtkWidget *widget; @@ -44,12 +45,17 @@ on_application_activate (GApplication *gapplication, box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); + gicon = g_themed_icon_new ("face-smile"); + model_button = g_object_new (GTK_TYPE_MODEL_BUTTON, "action-name", "app.beep", "text", "It’s-a-me! ModelButton", + "icon", gicon, NULL); gtk_container_add (GTK_CONTAINER (box), model_button); + g_object_unref (gicon); + widget = gtk_combo_box_text_new (); gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (widget), NULL, "GTK_BUTTON_ROLE_NORMAL"); @@ -63,12 +69,24 @@ on_application_activate (GApplication *gapplication, G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL); gtk_container_add (GTK_CONTAINER (box), widget); + widget = gtk_toggle_button_new_with_label (":centered"); + g_object_bind_property (widget, "active", + model_button, "centered", + G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL); + gtk_container_add (GTK_CONTAINER (box), widget); + widget = gtk_toggle_button_new_with_label (":iconic"); g_object_bind_property (widget, "active", model_button, "iconic", G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL); gtk_container_add (GTK_CONTAINER (box), widget); + widget = gtk_toggle_button_new_with_label (":inverted"); + g_object_bind_property (widget, "active", + model_button, "inverted", + G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL); + gtk_container_add (GTK_CONTAINER (box), widget); + widget = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_container_add (GTK_CONTAINER (widget), box); gtk_widget_show_all (widget);