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, see <http://www.gnu.org/licenses/>.
29 action_test_setup (ActionTest *fixture,
30 gconstpointer test_data)
32 fixture->action = gtk_action_new ("name", "label", NULL, NULL);
36 action_test_teardown (ActionTest *fixture,
37 gconstpointer test_data)
39 g_object_unref (fixture->action);
43 notify_count_emmisions (GObject *object,
47 unsigned int *i = data;
52 menu_item_label_notify_count (ActionTest *fixture,
53 gconstpointer test_data)
55 GtkWidget *item = gtk_menu_item_new ();
56 unsigned int emmisions = 0;
58 g_object_ref_sink (item);
59 g_signal_connect (item, "notify::label",
60 G_CALLBACK (notify_count_emmisions), &emmisions);
62 gtk_activatable_do_set_related_action (GTK_ACTIVATABLE (item),
65 g_assert_cmpuint (emmisions, ==, 1);
67 gtk_action_set_label (fixture->action, "new label");
69 g_assert_cmpuint (emmisions, ==, 2);
71 g_object_unref (item);
80 gtk_test_init (&argc, &argv, NULL);
82 g_test_add ("/Action/MenuItem/label-notify-count",
85 menu_item_label_notify_count,
86 action_test_teardown);