def main(self):
self.indicator = appindicator.Indicator.new(self.APPINDICATOR_ID, self.ICON_OFF,
appindicator.IndicatorCategory.SYSTEM_SERVICES)
self.indicator.set_status(appindicator.IndicatorStatus.ACTIVE)
self.indicator.set_menu(self.build_menu())
# This sets the handler for “INT” signal processing
#- the one issued by the OS when “Ctrl+C” is typed.
#The handler we assign to it is the “default” handler, which,
#in case of the interrupt signal, is to stop execution.
signal.signal(signal.SIGINT, signal.SIG_DFL) #listen to quit signal
notify.init(self.APPINDICATOR_ID)
self.update()
glib.timeout_add_seconds(self.UPDATE_FREQUENCY, self.update)
gtk.main()
评论列表
文章目录