mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 14:31:10 +00:00
testmodelbutton: Test :centered, :icon, :inverted
Test more stuff.
This commit is contained in:
parent
b2caaaa3f9
commit
7a75b89efe
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user