nx_work_log.sys_tray_icon.SysTrayIcon

class nx_work_log.sys_tray_icon.SysTrayIcon(icon, hover_text, menu_options, on_exit=None, default_menu_index=None, window_class_name=None, call_on_startup=None)

Bases: object

__init__(icon, hover_text, menu_options, on_exit=None, default_menu_index=None, window_class_name=None, call_on_startup=None)

The SysTrayIcon class implements an icon in the windows system tray, which allows left click on the icon for an action and right click for a menu :param icon: Full path to icon file :param hover_text: Text to show when hovering above icon :param menu_options: List of menu options and functions to call :param on_exit: FUnction to call when exiting :param default_menu_index: The menu item to select when clicking the icon :param window_class_name: Classname :param call_on_startup: Function to call on startup

Methods

__init__(icon, hover_text, menu_options[, ...])

The SysTrayIcon class implements an icon in the windows system tray, which allows left click on the icon for an action and right click for a menu :param icon: Full path to icon file :param hover_text: Text to show when hovering above icon :param menu_options: List of menu options and functions to call :param on_exit: FUnction to call when exiting :param default_menu_index: The menu item to select when clicking the icon :param window_class_name: Classname :param call_on_startup: Function to call on startup

command(hwnd, msg, wparam, lparam)

create_menu(menu, menu_options)

destroy(hwnd, msg, wparam, lparam)

execute_menu_option(id)

exit()

notify(hwnd, msg, wparam, lparam)

prep_menu_icon(icon)

refresh_icon([recreate])

Refresh the icon.

restart(hwnd, msg, wparam, lparam)

set_hover_text(hover_text)

set_icon(filename[, hover_text])

show_menu()

Attributes

EXIT

FIRST_ID

SPECIAL_ACTIONS

refresh_icon(recreate=False)

Refresh the icon. To be called after updating the icon. :param recreate: Recreate the icon

set_hover_text(hover_text)
set_icon(filename, hover_text=None)