Created
May 2, 2013 22:33
-
-
Save cas--/5505998 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
APPNAME = "My App" | |
ICON = "/usr/share/pixmaps/firefox.png" | |
from gi.repository import AppIndicator3 as AI | |
from gi.repository import Gtk | |
def sayhello(item): | |
print "menu item selected" | |
def scroll(aai, ind, steps): | |
print "hello" # doesn't print anything | |
def makemenu(): | |
' Set up the menu ' | |
menu = Gtk.Menu() | |
check = Gtk.MenuItem('Check') | |
exitor = Gtk.MenuItem('Quit') | |
check.connect('activate', sayhello) | |
check.show() | |
exitor.connect('activate', Gtk.main_quit) | |
exitor.show() | |
menu.append(check) | |
menu.append(exitor) | |
menu.show() | |
return menu | |
def startapp(): | |
ai = AI.Indicator.new(APPNAME, ICON, AI.IndicatorCategory.HARDWARE) | |
ai.set_status(AI.IndicatorStatus.ACTIVE) | |
ai.set_menu(makemenu()) | |
ai.connect("scroll-event", scroll) | |
Gtk.main() | |
startapp() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment