def __init__(self): wx.TaskBarIcon.__init__(self) self.ID_MINIMIZE = wx.NewId() # Let self.restore have a different ID from menumin in the main menu, # in fact this is a check item, while the other is a normal item self.ID_RESTORE = wx.NewId() # Don't use wx.ID_EXIT because it assigns a Ctrl+q accelerator # automatically self.ID_EXIT = wx.NewId() config = coreaux_api.get_plugin_configuration('wxtrayicon')( 'GlobalShortcuts') wxgui_api.install_bundled_icon("wxtrayicon", '@tray', ("Tango", "tray16.png")) wxgui_api.install_bundled_icon("wxtrayicon", '@traywarning', ("warning24.png", )) self.icon = BlinkingIcon(self) menumin = wx.MenuItem(wxgui_api.get_menu_file(), self.ID_MINIMIZE, '&Minimize to tray\t{}'.format(config['minimize']), 'Minimize the main window to tray icon') menumin.SetBitmap(wxgui_api.get_menu_icon('@tray')) wxgui_api.add_menu_file_item(menumin) self.Bind(wx.EVT_TASKBAR_LEFT_DOWN, self._handle_left_click) self.Bind(wx.EVT_TASKBAR_RIGHT_DOWN, self._handle_right_click) wxgui_api.bind_to_close_window(self.hide_main_window) wxgui_api.bind_to_menu(self.hide_main_window, menumin) core_api.bind_to_exit_app_2(self.remove)
def __init__(self): wx.TaskBarIcon.__init__(self) self.ID_MINIMIZE = wx.NewId() # Let self.restore have a different ID from menumin in the main menu, # in fact this is a check item, while the other is a normal item self.ID_RESTORE = wx.NewId() # Don't use wx.ID_EXIT because it assigns a Ctrl+q accelerator # automatically self.ID_EXIT = wx.NewId() config = coreaux_api.get_plugin_configuration('wxtrayicon')( 'GlobalShortcuts') wxgui_api.install_bundled_icon("wxtrayicon", '@tray', ("Tango", "tray16.png")) wxgui_api.install_bundled_icon("wxtrayicon", '@traywarning', ("warning24.png", )) self.icon = BlinkingIcon(self) menumin = wx.MenuItem( wxgui_api.get_menu_file(), self.ID_MINIMIZE, '&Minimize to tray\t{}'.format(config['minimize']), 'Minimize the main window to tray icon') menumin.SetBitmap(wxgui_api.get_menu_icon('@tray')) wxgui_api.add_menu_file_item(menumin) self.Bind(wx.EVT_TASKBAR_LEFT_DOWN, self._handle_left_click) self.Bind(wx.EVT_TASKBAR_RIGHT_DOWN, self._handle_right_click) wxgui_api.bind_to_close_window(self.hide_main_window) wxgui_api.bind_to_menu(self.hide_main_window, menumin) core_api.bind_to_exit_app_2(self.remove)
def __init__(self): self.ref_id = wx.NewId() self.DELAY = 50 # Set SDELAY shorter than DELAY, so that if an alarm is activated at # the same time an alarm is dismissed, there's a better chance that # the icon starts blinking self.SDELAY = 30 # Initialize self.delay and self.sdelay with a dummy function (int) self.delay = wx.CallLater(1, int) self.sdelay = wx.CallLater(1, int) self.active_alarms = {} self._update_tooltip() organism_alarms_api.bind_to_alarm(self._blink_after) organism_alarms_api.bind_to_alarm_off(self._stop_after) wxgui_api.bind_to_close_database(self._stop_after) core_api.bind_to_exit_app_2(self._exit)
def __init__(self): self.ref_id = wx.NewId() self.DELAY = 50 # Set SDELAY shorter than DELAY, so that if an alarm is activated at # the same time an alarm is dismissed, there's a better chance that # the icon starts blinking self.SDELAY = 30 # Initialize self.delay and self.sdelay with a dummy function (int) self.delay = wx.CallLater(1, int) self.sdelay = wx.CallLater(1, int) self.active_alarms = {} self._update_tooltip() organism_alarms_api.bind_to_alarm(self._blink_after) organism_alarms_api.bind_to_alarm_off(self._stop_after) wxgui_api.bind_to_close_database(self._stop_after) core_api.bind_to_exit_app_2(self._exit)