summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2001-02-19 22:25:30 +0000
committerHavoc Pennington <hp@src.gnome.org>2001-02-19 22:25:30 +0000
commitf4fa22da5524e90e70a14b9630d810b23d0b520e (patch)
tree2118721fb1b3fd3f74e5427315266c1d94dda7cf /tests
parent6fb6363e3013d67e19b9e2b1e5b9d1a3c8f67494 (diff)
downloadgtk+-f4fa22da5524e90e70a14b9630d810b23d0b520e.tar.gz
test was backward, so deprecated functions were excluded by default
2001-02-19 Havoc Pennington <hp@redhat.com> * gdk/gdkcolor.h: test was backward, so deprecated functions were excluded by default * gtk/gtkstyle.c (gtk_default_draw_diamond): draw etched in/out, clean up the old code a bit * gtk/gtkradiobutton.c (gtk_radio_button_draw_indicator): draw inconsistent state * gtk/gtkradiomenuitem.c (gtk_radio_menu_item_draw_indicator): draw inconsistent state * gtk/testgtk.c (create_toggle_buttons): add test for inconsistent (create_menu): add inconsistent test * gtk/gtkcheckmenuitem.c (gtk_check_menu_item_set_inconsistent): new function (gtk_check_menu_item_get_inconsistent): new function (gtk_real_check_menu_item_draw_indicator): draw the inconsistent state (using etched in for now) * gtk/gtkcheckbutton.c (gtk_real_check_button_draw_indicator): draw inconsistent state * gtk/gtktogglebutton.c (gtk_toggle_button_set_inconsistent): new function, used when the user has selected a range of stuff in different states (gtk_toggle_button_get_inconsistent): accessor for that (gtk_toggle_button_paint): draw inconsistent state (etched in? don't know what else to do)
Diffstat (limited to 'tests')
-rw-r--r--tests/testgtk.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 97bf5e270d..41374de05b 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -316,6 +316,10 @@ create_toggle_buttons (void)
button = gtk_toggle_button_new_with_label ("button3");
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
+ button = gtk_toggle_button_new_with_label ("inconsistent");
+ gtk_toggle_button_set_inconsistent (GTK_TOGGLE_BUTTON (button), TRUE);
+ gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
+
separator = gtk_hseparator_new ();
gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0);
@@ -378,6 +382,10 @@ create_check_buttons (void)
button = gtk_check_button_new_with_label ("button3");
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
+ button = gtk_check_button_new_with_label ("inconsistent");
+ gtk_toggle_button_set_inconsistent (GTK_TOGGLE_BUTTON (button), TRUE);
+ gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
+
separator = gtk_hseparator_new ();
gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0);
@@ -445,6 +453,12 @@ create_radio_buttons (void)
"button3");
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
+ button = gtk_radio_button_new_with_label (
+ gtk_radio_button_group (GTK_RADIO_BUTTON (button)),
+ "inconsistent");
+ gtk_toggle_button_set_inconsistent (GTK_TOGGLE_BUTTON (button), TRUE);
+ gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
+
separator = gtk_hseparator_new ();
gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0);
@@ -2788,15 +2802,22 @@ create_menu (gint depth, gint length, gboolean tearoff)
for (i = 0, j = 1; i < length; i++, j++)
{
sprintf (buf, "item %2d - %d", depth, j);
+
menuitem = gtk_radio_menu_item_new_with_label (group, buf);
group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (menuitem));
+
if (depth % 2)
gtk_check_menu_item_set_show_toggle (GTK_CHECK_MENU_ITEM (menuitem), TRUE);
+
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
gtk_widget_show (menuitem);
if (i == 3)
gtk_widget_set_sensitive (menuitem, FALSE);
+ if (i == 5)
+ gtk_check_menu_item_set_inconsistent (GTK_CHECK_MENU_ITEM (menuitem),
+ TRUE);
+
if (i < 5)
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), create_menu (depth - 1, 5, TRUE));
}