aboutsummaryrefslogtreecommitdiff
path: root/bindings
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-07-22 13:58:39 -0500
committerTed Gould <ted@gould.cx>2011-07-22 13:58:39 -0500
commit5c4ee09c774dccfb8af7bf89b1709c93d3db2769 (patch)
treed5915ea399ae5d7731b07e23725c8fe6cba070a4 /bindings
parentbf95161bb260f193fbb8508f5f25c56080498a31 (diff)
parentf551fdbd371ee30b8be507f9471b252ab84504c9 (diff)
downloadlibayatana-appindicator-5c4ee09c774dccfb8af7bf89b1709c93d3db2769.tar.gz
libayatana-appindicator-5c4ee09c774dccfb8af7bf89b1709c93d3db2769.tar.bz2
libayatana-appindicator-5c4ee09c774dccfb8af7bf89b1709c93d3db2769.zip
Adding in support for the secondary activate (middle click)
Diffstat (limited to 'bindings')
-rw-r--r--bindings/mono/examples/IndicatorExample.cs9
-rw-r--r--bindings/vala/examples/indicator-example.vala5
2 files changed, 11 insertions, 3 deletions
diff --git a/bindings/mono/examples/IndicatorExample.cs b/bindings/mono/examples/IndicatorExample.cs
index c18a665..7413c54 100644
--- a/bindings/mono/examples/IndicatorExample.cs
+++ b/bindings/mono/examples/IndicatorExample.cs
@@ -41,12 +41,19 @@ public class IndicatorExample
indicator.Status = Status.Attention;
Menu menu = new Menu ();
- menu.Append (new MenuItem ("Foo"));
+ var foo = new MenuItem ("Foo");
+ menu.Append (foo);
+ foo.Activated += delegate {
+ System.Console.WriteLine ("Foo item has been activated");
+ };
+
menu.Append (new MenuItem ("Bar"));
indicator.Menu = menu;
indicator.Menu.ShowAll ();
+ indicator.SecondaryActivateTarget = foo;
+
win.ShowAll ();
Application.Run ();
diff --git a/bindings/vala/examples/indicator-example.vala b/bindings/vala/examples/indicator-example.vala
index 621c962..7bb1d7d 100644
--- a/bindings/vala/examples/indicator-example.vala
+++ b/bindings/vala/examples/indicator-example.vala
@@ -47,14 +47,15 @@ public class IndicatorExample {
item.show();
menu.append(item);
- item = new MenuItem.with_label("Bar");
+ var bar = item = new MenuItem.with_label("Bar");
item.show();
item.activate.connect(() => {
- indicator.set_status(IndicatorStatus.ATTENTION);
+ indicator.set_status(IndicatorStatus.ACTIVE);
});
menu.append(item);
indicator.set_menu(menu);
+ indicator.set_secondary_activate_target(bar);
win.show_all();