Package traylib :: Module tray :: Class Tray
[frames] | no frames]

Class Tray

source code

object --+
         |
        Tray

Instance Methods
 
__init__(self, icon_config, tray_config, menu_icon_class=MenuIcon)
Creates a new Tray.
source code
 
add_box(self, box_id, separator=False)
Adds a box to the Tray to which icons can be added via the add_icon() method.
source code
 
add_icon(self, box_id, icon_id, icon)
Adds an Icon to the Tray.
source code
 
remove_icon(self, icon_id)
Removes an icon from the Tray.
source code
 
destroy(self)
Destroys the Tray and the container containing it.
source code
 
forget_menus(self)
Makes the Tray forget its main menu.
source code
 
get_icon(self, id)
Returns the Icon with the identifier id
source code
 
set_container(self, container)
Adds the Tray to the gtk.Container container after removing it from its current container.
source code
 
update_option_separators(self) source code
 
update_option_menus(self) source code
 
add_custom_menu_items(self, menu)
Override this to add custom items to the menu.
source code
 
quit(self)
Override this to clean up when the container containing the tray is destroyed.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables
  icon_config = property(lambda self: self.__icon_config)
  tray_config = property(lambda self: self.__tray_config)
  icon_ids = property(lambda self: self.__icons.keys())
  icons = property(lambda self: self.__icons.values())
  menu_icon = property(lambda self: self.__menu_icon)
Properties

Inherited from object: __class__

Method Details

__init__(self, icon_config, tray_config, menu_icon_class=MenuIcon)
(Constructor)

source code 

Creates a new Tray.

Parameters:
Overrides: object.__init__

add_box(self, box_id, separator=False)

source code 

Adds a box to the Tray to which icons can be added via the add_icon() method.

Parameters:
  • box_id - An identifier for the box.

add_icon(self, box_id, icon_id, icon)

source code 

Adds an Icon to the Tray.

Parameters:
  • box_id - The identifier of the box the icon should be added to.
  • icon_id - The identifier of the icon.
  • icon - The Icon to be added.

remove_icon(self, icon_id)

source code 

Removes an icon from the Tray.

Parameters:
  • icon_id - The identifier of the icon.

forget_menus(self)

source code 

Makes the Tray forget its main menu. Call this if something affecting the main menu has changed.

get_icon(self, id)

source code 

Returns the Icon with the identifier id

Parameters:
  • id - The identifier of the Icon
Returns:
The Icon with the identifier id. Returns None if the Tray has no Icon with the identifier id.

set_container(self, container)

source code 

Adds the Tray to the gtk.Container container after removing it from its current container.

Parameters:
  • container - The gtk.Container the Tray will be added to (may be None).

add_custom_menu_items(self, menu)

source code 

Override this to add custom items to the menu. Return True if you did add any items.