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 /example/simple-client-vala.vala | |
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 'example/simple-client-vala.vala')
-rw-r--r-- | example/simple-client-vala.vala | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/example/simple-client-vala.vala b/example/simple-client-vala.vala index 61e0c2f..8d661ce 100644 --- a/example/simple-client-vala.vala +++ b/example/simple-client-vala.vala @@ -72,6 +72,17 @@ class SimpleClient { menu.append(mi); mi.activate.connect(() => { print("Sub3\n"); }); + mi = new MenuItem.with_label("Toggle Attention"); + menu.append(mi); + mi.activate.connect(() => { + if (ci.get_status() == IndicatorStatus.ATTENTION) + ci.set_status(IndicatorStatus.ACTIVE); + else + ci.set_status(IndicatorStatus.ATTENTION); + }); + + ci.set_secondary_activate_target(mi); + menu.show_all(); item.set_submenu(menu); } @@ -109,7 +120,7 @@ class SimpleClient { chk.show(); var radio = new RadioMenuItem.with_label(new SList<RadioMenuItem>(), "2"); - radio.activate.connect(() => { print("2\n"); }); + radio.activate.connect(() => { print("2\n"); }); menu.append(radio); radio.show(); |