mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 10:50:10 +00:00
testmodelbutton: Test :centered, :icon, :inverted
Test more stuff.
This commit is contained in:
parent
15b569e64d
commit
8d8db89669
@ -19,6 +19,7 @@ on_application_activate (GApplication *gapplication,
|
||||
|
||||
GSimpleAction *action;
|
||||
GtkWidget *box;
|
||||
GIcon *gicon;
|
||||
GtkWidget *model_button;
|
||||
GtkWidget *widget;
|
||||
|
||||
@ -43,12 +44,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");
|
||||
@ -62,12 +68,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 (widget);
|
||||
|
Loading…
Reference in New Issue
Block a user