aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
Diffstat (limited to 'example')
-rw-r--r--example/simple-client-vala.vala5
-rw-r--r--example/simple-client.c9
2 files changed, 14 insertions, 0 deletions
diff --git a/example/simple-client-vala.vala b/example/simple-client-vala.vala
index 18ece22..61e0c2f 100644
--- a/example/simple-client-vala.vala
+++ b/example/simple-client-vala.vala
@@ -87,6 +87,11 @@ class SimpleClient {
}
public void run() {
+
+ ci.scroll_event.connect((delta, direction) => {
+ print(@"Got scroll event! delta: $delta, direction: $direction\n");
+ });
+
Timeout.add_seconds(1, () => {
percentage = (percentage + 1) % 100;
if (can_haz_label) {
diff --git a/example/simple-client.c b/example/simple-client.c
index ac8360f..1cf06dc 100644
--- a/example/simple-client.c
+++ b/example/simple-client.c
@@ -98,6 +98,12 @@ image_clicked_cb (GtkWidget *widget, gpointer data)
}
static void
+scroll_event_cb (AppIndicator * ci, gint delta, guint direction)
+{
+ g_print("Got scroll event! delta: %d, direction: %d\n", delta, direction);
+}
+
+static void
append_submenu (GtkWidget *item)
{
GtkWidget *menu;
@@ -162,6 +168,9 @@ main (int argc, char ** argv)
app_indicator_set_attention_icon(ci, "indicator-messages-new");
app_indicator_set_label (ci, "1%", "100%");
+ g_signal_connect (ci, "scroll-event",
+ G_CALLBACK (scroll_event_cb), NULL);
+
g_timeout_add_seconds(1, percent_change, ci);
menu = gtk_menu_new ();