3 * Authors: Jan Arne Petersen <jpetersen@openismus.com>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
31 action_test_setup (ActionTest *fixture,
32 gconstpointer test_data)
34 fixture->action = gtk_action_new ("name", "label", NULL, NULL);
38 action_test_teardown (ActionTest *fixture,
39 gconstpointer test_data)
41 g_object_unref (fixture->action);
45 notify_count_emmisions (GObject *object,
49 unsigned int *i = data;
54 menu_item_label_notify_count (ActionTest *fixture,
55 gconstpointer test_data)
57 GtkWidget *item = gtk_menu_item_new ();
58 unsigned int emmisions = 0;
60 g_object_ref_sink (item);
61 g_signal_connect (item, "notify::label",
62 G_CALLBACK (notify_count_emmisions), &emmisions);
64 gtk_activatable_do_set_related_action (GTK_ACTIVATABLE (item),
67 g_assert_cmpuint (emmisions, ==, 1);
69 gtk_action_set_label (fixture->action, "new label");
71 g_assert_cmpuint (emmisions, ==, 2);
73 g_object_unref (item);
82 gtk_test_init (&argc, &argv, NULL);
84 g_test_add ("/Action/MenuItem/label-notify-count",
87 menu_item_label_notify_count,
88 action_test_teardown);