aboutsummaryrefslogtreecommitdiff
path: root/example/simple-client.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2009-12-09 12:02:20 -0600
committerTed Gould <ted@gould.cx>2009-12-09 12:02:20 -0600
commitb67737d41f7c55e5d440e2eebd6d6adca05fb419 (patch)
tree34d9a0493282c6764cad571a5b6563df9c5bec9f /example/simple-client.c
parentec3c1bee24ce4da8bef326e8f2b659c846ff35b7 (diff)
parentbae74eff1707ab9abac1f6122506ff1b7cc20098 (diff)
downloadayatana-indicator-application-b67737d41f7c55e5d440e2eebd6d6adca05fb419.tar.gz
ayatana-indicator-application-b67737d41f7c55e5d440e2eebd6d6adca05fb419.tar.bz2
ayatana-indicator-application-b67737d41f7c55e5d440e2eebd6d6adca05fb419.zip
* Upstream update
* Adding in documentation * Adding a pkg-config .pc file for libappindicator
Diffstat (limited to 'example/simple-client.c')
-rw-r--r--example/simple-client.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/example/simple-client.c b/example/simple-client.c
index ab2e24d..ea4da9d 100644
--- a/example/simple-client.c
+++ b/example/simple-client.c
@@ -26,6 +26,14 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
GMainLoop * mainloop = NULL;
+static void
+item_clicked_cb (GtkWidget *widget, gpointer data)
+{
+ const gchar *text = (const gchar *)data;
+
+ g_print ("%s clicked!\n", text);
+}
+
int
main (int argc, char ** argv)
{
@@ -46,12 +54,18 @@ main (int argc, char ** argv)
menu = gtk_menu_new ();
GtkWidget *item = gtk_menu_item_new_with_label ("1");
+ g_signal_connect (item, "activate",
+ G_CALLBACK (item_clicked_cb), "1");
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
item = gtk_menu_item_new_with_label ("2");
+ g_signal_connect (item, "activate",
+ G_CALLBACK (item_clicked_cb), "2");
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
item = gtk_menu_item_new_with_label ("3");
+ g_signal_connect (item, "activate",
+ G_CALLBACK (item_clicked_cb), "3");
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
app_indicator_set_menu (ci, GTK_MENU (menu));