summaryrefslogtreecommitdiff
path: root/tests/teststatusicon.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2006-12-22 07:18:21 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2006-12-22 07:18:21 +0000
commitd9a6a829ce282ab60ef1b13834616eb257782975 (patch)
tree0863914f15cc94a81de01449ec4137133f32d793 /tests/teststatusicon.c
parent33153bec3679e9013bbcb819bc8b028cc4190ce0 (diff)
downloadgtk+-d9a6a829ce282ab60ef1b13834616eb257782975.tar.gz
Make it possible to track the embeddedness of statusicon (#387215, Martyn
2006-12-22 Matthias Clasen <mclasen@redhat.com> Make it possible to track the embeddedness of statusicon (#387215, Martyn Russell, patch by Christian Persch) * gtk/gtkstatusicon.c: Add orientation and embedded properties. * gtk/gtkplug.c: * gtk/gtkplug-x11.c: Add an embedded property. * tests/teststatusicon.c: Test the new properties.
Diffstat (limited to 'tests/teststatusicon.c')
-rwxr-xr-xtests/teststatusicon.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/tests/teststatusicon.c b/tests/teststatusicon.c
index 85007e3f34..d17c4c8283 100755
--- a/tests/teststatusicon.c
+++ b/tests/teststatusicon.c
@@ -34,6 +34,29 @@ static gint timeout = 0;
static GSList *icons = NULL;
static void
+size_changed_cb (GtkStatusIcon *icon,
+ int size)
+{
+ g_print ("status icon %p size-changed size = %d\n", icon, size);
+}
+
+static void
+embedded_changed_cb (GtkStatusIcon *icon)
+{
+ g_print ("status icon %p embedded changed to %d\n", icon,
+ gtk_status_icon_is_embedded (icon));
+}
+
+static void
+orientation_changed_cb (GtkStatusIcon *icon)
+{
+ GtkOrientation orientation;
+
+ g_object_get (icon, "orientation", &orientation, NULL);
+ g_print ("status icon %p orientation changed to %d\n", icon, orientation);
+}
+
+static void
update_icons (void)
{
GSList *l;
@@ -264,7 +287,11 @@ main (int argc, char **argv)
gtk_status_icon_set_screen (icon, gdk_display_get_screen (display, i));
update_icons ();
- gtk_status_icon_set_blinking (GTK_STATUS_ICON (icon), TRUE);
+ g_signal_connect (icon, "size-changed", G_CALLBACK (size_changed_cb), NULL);
+ g_signal_connect (icon, "notify::embedded", G_CALLBACK (embedded_changed_cb), NULL);
+ g_signal_connect (icon, "notify::orientation", G_CALLBACK (orientation_changed_cb), NULL);
+ g_print ("icon size %d\n", gtk_status_icon_get_size (icon));
+ gtk_status_icon_set_blinking (GTK_STATUS_ICON (icon), FALSE);
g_signal_connect (icon, "activate",
G_CALLBACK (icon_activated), NULL);