Skip to content

Instantly share code, notes, and snippets.

@cas--
Created May 2, 2013 22:33
Show Gist options
  • Save cas--/5505998 to your computer and use it in GitHub Desktop.
Save cas--/5505998 to your computer and use it in GitHub Desktop.
#!/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