aboutsummaryrefslogtreecommitdiff
path: root/example/simple-client.c
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2011-07-18 18:13:09 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2011-07-18 18:13:09 +0200
commit383469d022e9b0c9a08321c7ec9c186fc09c1a36 (patch)
tree3fd849e6ddca2b1b2856cac2e8f5fc8e652e9e40 /example/simple-client.c
parentd24b2f255e7135ceacd1ab7388e514f5f2b5edcf (diff)
downloadlibayatana-appindicator-383469d022e9b0c9a08321c7ec9c186fc09c1a36.tar.gz
libayatana-appindicator-383469d022e9b0c9a08321c7ec9c186fc09c1a36.tar.bz2
libayatana-appindicator-383469d022e9b0c9a08321c7ec9c186fc09c1a36.zip
examples: add secondary-activate signal usage to Vala and C
Diffstat (limited to 'example/simple-client.c')
-rw-r--r--example/simple-client.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/example/simple-client.c b/example/simple-client.c
index 9e63e14..32e7240 100644
--- a/example/simple-client.c
+++ b/example/simple-client.c
@@ -98,12 +98,21 @@ image_clicked_cb (GtkWidget *widget, gpointer data)
}
static void
-scroll_event_cb (AppIndicator * ci, gint delta, guint direction)
+scroll_event_cb (AppIndicator * ci, gint delta, guint direction, gpointer data)
{
g_print("Got scroll event! delta: %d, direction: %d\n", delta, direction);
}
static void
+secondary_activate_cb (AppIndicator * ci, gint x, gint y, gpointer data)
+{
+ g_print("Got secondary activate event at %dx%d\n", x, y);
+
+ if (app_indicator_get_status (ci) == APP_INDICATOR_STATUS_ATTENTION)
+ app_indicator_set_status(ci, APP_INDICATOR_STATUS_ACTIVE);
+}
+
+static void
append_submenu (GtkWidget *item)
{
GtkWidget *menu;
@@ -171,6 +180,9 @@ main (int argc, char ** argv)
g_signal_connect (ci, "scroll-event",
G_CALLBACK (scroll_event_cb), NULL);
+ g_signal_connect (ci, "secondary-activate",
+ G_CALLBACK (secondary_activate_cb), NULL);
+
g_timeout_add_seconds(1, percent_change, ci);
menu = gtk_menu_new ();