diff options
author | Ted Gould <ted@gould.cx> | 2011-07-22 13:58:39 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-07-22 13:58:39 -0500 |
commit | 5c4ee09c774dccfb8af7bf89b1709c93d3db2769 (patch) | |
tree | d5915ea399ae5d7731b07e23725c8fe6cba070a4 /bindings | |
parent | bf95161bb260f193fbb8508f5f25c56080498a31 (diff) | |
parent | f551fdbd371ee30b8be507f9471b252ab84504c9 (diff) | |
download | libayatana-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.cs | 9 | ||||
-rw-r--r-- | bindings/vala/examples/indicator-example.vala | 5 |
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(); |