Package traylib :: Module winicon :: Class WinIcon
[frames] | no frames]

Class WinIcon

source code

gtk.EventBox --+    
               |    
      object --+    
               |    
       icon.Icon --+
                   |
                  WinIcon

An Icon representing a group of windows. You can add/remove windows using the add_window() and remove_window() methods.

Instance Methods
 
__init__(self, icon_config, win_config)
Creates a new WinIcon.
source code
 
is_minimized(self)
Returns: {True} if all visible windows of the WinIcon are minimized.
source code
 
update_name(self)
Updates the name by calling make_name()
source code
 
update_windows(self)
Updates the list of visible windows.
source code
 
activate_next_window(self, time=0L)
If the active window is in the WinIcon's list of visible windows, activates the window after the active window in the list of visible windows.
source code
 
activate_previous_window(self, time=0L)
If the active window is in the WinIcon's list of visible windows, activates the window before the active window in the list of visible windows.
source code
 
add_window(self, window)
Adds window to the WinIcon's list of windows.
source code
 
remove_window(self, window)
Removes window from the WinIcon's list of windows.
source code
 
window_is_visible(self, window)
Returns: True if the window should show up in the WinIcon's menu.
source code
 
make_visibility(self)
Determines the visibility.
source code
 
make_zoom_factor(self)
Determines the zoom factor.
source code
 
make_has_arrow(self)
Determines whether to show an arrow or not.
source code
 
make_tooltip(self)
Determines the WinIcon's tooltip by calling make_name().
source code
 
click(self, time=0L)
If the WinIcon has only one visible window, it is activated or minimized, depending on its current state.
source code
 
get_menu_left(self)
Returns: The menu when the WinIcon was left-clicked.
source code
 
get_menu_right(self)
Returns: The menu when the WinIcon was right-clicked.
source code
 
mouse_wheel_up(self, time=0L)
Activates the next window.
source code
 
mouse_wheel_down(self, time=0L)
Activates the previous window.
source code
 
spring_open(self, time=0L)
Activates the next window.
source code
 
should_hide_if_no_visible_windows(self)
Override this to determine whether the WinIcon should hide if it has no visible windows anymore.
source code
 
menu_has_kill(self)
Override this to determine whether the WinIcon's menu has a "kill" menu item.
source code
 
update_option_all_workspaces(self) source code
 
update_option_arrow(self) source code
 
make_name(self)
Override this to determine the WinIcon's name.
source code
 
should_have_window(self, window) source code
 
should_use_icon_for_winmenu(self) source code
 
get_root_path(self) source code

Inherited from icon.Icon: destroy, hide, make_emblem, make_icon, make_is_drop_target, set_blinking, show, update_emblem, update_has_arrow, update_icon, update_is_drop_target, update_option_edge, update_option_effects, update_option_hidden, update_option_size, update_tooltip, update_visibility, update_zoom_factor, uris_dropped

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

Class Variables
  name = property(lambda self: self.__name)
The WinIcon's name.
  visible_windows = property(lambda self: self.__visible_windows)
The list of visible windows.
  has_active_window = property(lambda self: screen.get_active_wi...
{True} if the WinIcon has the active window.
  has_visible_windows = property(lambda self: bool(self.__visibl...
{True} if the WinIcon has any visible windows.
  has_windows = property(lambda self: bool(self.__windows))
{True} if the WinIcon has any windows.

Inherited from icon.Icon: has_arrow, icon, icon_config, is_drop_target, size, tooltip

Properties

Inherited from object: __class__

Method Details

__init__(self, icon_config, win_config)
(Constructor)

source code 

Creates a new WinIcon.

Parameters:
  • win_config - The WinConfig controlling the configuration of the WinIcon.
Overrides: object.__init__

is_minimized(self)

source code 
Returns:
{True} if all visible windows of the WinIcon are minimized.

update_windows(self)

source code 

Updates the list of visible windows. Also calls update_has_arrow(), update_tooltip(), update_zoom_factor() and update_visibility().

activate_next_window(self, time=0L)

source code 

If the active window is in the WinIcon's list of visible windows, activates the window after the active window in the list of visible windows. If not, the first visible window of the WinIcon is activated.

activate_previous_window(self, time=0L)

source code 

If the active window is in the WinIcon's list of visible windows, activates the window before the active window in the list of visible windows. If not, the first visible window of the WinIcon is activated.

add_window(self, window)

source code 

Adds window to the WinIcon's list of windows.

Parameters:
  • window - The window to be added.

remove_window(self, window)

source code 

Removes window from the WinIcon's list of windows.

Parameters:
  • window - The window to be removed.

window_is_visible(self, window)

source code 
Returns:
True if the window should show up in the WinIcon's menu.

make_visibility(self)

source code 

Determines the visibility.

Returns:
True if the WinIcon has any visible windows or if it should not hide icons with no visible windows.
Overrides: icon.Icon.make_visibility

make_zoom_factor(self)

source code 

Determines the zoom factor.

Returns:
If the icon has the active window: 1.5 If the icon has only minimized windows: half the zoom factor returned by Icon.make_zoom_factor() Else: the zoom factor returned by Icon.make_zoom_factor()
Overrides: icon.Icon.make_zoom_factor

make_has_arrow(self)

source code 

Determines whether to show an arrow or not.

Returns:
True if the icon has more than one visible window and its WinConfig is configured to show an arrow.
Overrides: icon.Icon.make_has_arrow

make_tooltip(self)

source code 

Determines the WinIcon's tooltip by calling make_name().

Returns:
The new tooltip of the WinIcon.
Overrides: icon.Icon.make_tooltip

click(self, time=0L)

source code 

If the WinIcon has only one visible window, it is activated or minimized, depending on its current state. If it's on a different workspace, that workspace is also activated.

Parameters:
  • time - The time of the click event.
Returns:
True if some action could be performed.
Overrides: icon.Icon.click

get_menu_left(self)

source code 

Override this to determine the menu that pops up when left-clicking the Icon. (In case the click() method returned False.)

Returns:
The menu when the WinIcon was left-clicked. If it has more than one visible window, returns a WindowMenu where a window can be selected to be activated. Else, returns None.
Overrides: icon.Icon.get_menu_left

get_menu_right(self)

source code 

Override this to determine the menu that pops up when right-clicking the Icon.

Returns:
The menu when the WinIcon was right-clicked. If it has more than one visible window, returns a WindowMenu with a submenu of window actions for each window. If there's only one visible window, returns a WindowActionMenu for that window. Else, returns None.
Overrides: icon.Icon.get_menu_right

mouse_wheel_up(self, time=0L)

source code 

Activates the next window.

Parameters:
  • time - The time of the scroll event.
Returns:
True if the next window could be activated.
Overrides: icon.Icon.mouse_wheel_up

See Also: WinIcon.activate_next_window()

mouse_wheel_down(self, time=0L)

source code 

Activates the previous window.

Parameters:
  • time - The time of the scroll event.
Returns:
True if the previous window could be activated.
Overrides: icon.Icon.mouse_wheel_down

spring_open(self, time=0L)

source code 

Activates the next window.

Returns:
True if the next window could be activated.
Overrides: icon.Icon.spring_open

should_hide_if_no_visible_windows(self)

source code 

Override this to determine whether the WinIcon should hide if it has no visible windows anymore.

Returns:
True

menu_has_kill(self)

source code 

Override this to determine whether the WinIcon's menu has a "kill" menu item.

Returns:
True

make_name(self)

source code 

Override this to determine the WinIcon's name.

Returns:
The new name of the WinIcon.

Class Variable Details

has_active_window

{True} if the WinIcon has the active window.

Value:
property(lambda self: screen.get_active_window() in self.__windows)

has_visible_windows

{True} if the WinIcon has any visible windows.

Value:
property(lambda self: bool(self.__visible_windows))