WindowManager#
- class ignis.window_manager.WindowManager(*args: Any, **kwargs: Any)#
A class for managing window objects.
Example usage:
from ignis.window_manager import WindowManager window_manager = WindowManager.get_default() # Open, close, or toggle a window window_manager.open_window("window-name") window_manager.close_window("window-name") window_manager.toggle_window("window-name") # Get an instance of a window some_window = window_manager.get_window("window-name")
- get_window(window_name: str) gi.repository.Gtk.Window #
Get a window by name.
- Parameters:
window_name (
str
) -- The window's namespace.- Return type:
Window
- Returns:
The window object.
- Raises:
WindowNotFoundError -- If a window with the given namespace does not exist.
- add_window(window_name: str, window: gi.repository.Gtk.Window) None #
Add a window. You typically shouldn't use this method, as windows are added automatically.
- Parameters:
window_name (
str
) -- The window's namespace.window (
Window
) -- The window instance.
- Raises:
WindowAddedError -- If a window with the given namespace already exists.
- Return type:
- remove_window(window_name: str) None #
Remove a window by its name. This will not destroy the window.
- Parameters:
window_name (
str
) -- The window's namespace.- Raises:
WindowNotFoundError -- If a window with the given namespace does not exist.
- Return type:
- open_window(window_name: str) None #
Open (show) a window by its name.
- Parameters:
window_name (
str
) -- The window's namespace.- Raises:
WindowNotFoundError -- If a window with the given namespace does not exist.
- Return type:
- close_window(window_name: str) None #
Close (hide) a window by its name.
- Parameters:
window_name (
str
) -- The window's namespace.- Raises:
WindowNotFoundError -- If a window with the given namespace does not exist.
- Return type:
- toggle_window(window_name: str) None #
Toggle (change visibility to opposite state) a window by its name.
- Parameters:
window_name (
str
) -- The window's namespace.- Raises:
WindowNotFoundError -- If a window with the given namespace does not exist.
- Return type: