diff --git a/spacetray.py b/spacetray.py index 6e693e0..3d26fb3 100755 --- a/spacetray.py +++ b/spacetray.py @@ -7,13 +7,13 @@ import sys gi.require_version('Gtk', '3.0') from gi.repository import Gtk gi.require_version('AppIndicator3', '0.1') -from gi.repository import AppIndicator3 +from gi.repository import AppIndicator3 as AppIndicator -__VERSION__ = "0.0.2" +__VERSION__ = "0.0.3" -def menuitem_response(w, buf): - print(buf) +def menuitem_response(w, label): + print(label) def exit_app(): @@ -21,10 +21,10 @@ def exit_app(): if __name__ == "__main__": - ind = AppIndicator3.Indicator.new("example-simple-client", - "indicator-messages", - AppIndicator3.IndicatorCategory.APPLICATION_STATUS) - ind.set_status(AppIndicator3.IndicatorStatus.ACTIVE) + ind = AppIndicator.Indicator.new("example-simple-client", + "indicator-messages", + AppIndicator.IndicatorCategory.APPLICATION_STATUS) + ind.set_status(AppIndicator.IndicatorStatus.ACTIVE) ind.set_attention_icon("indicator-messages-new") # create a menu @@ -32,12 +32,12 @@ if __name__ == "__main__": # create some sub menus for i in range(3): - buf = "Test-sub-menu - %d" % i - menu_items = Gtk.MenuItem(buf) + label = "Test-sub-menu - %d" % i + menu_items = Gtk.MenuItem(label=label) menu.append(menu_items) # this is where you would connect your menu item up with a function: - menu_items.connect("activate", menuitem_response, buf) + menu_items.connect("activate", menuitem_response, label) # show the items menu_items.show()