Skip to content

pywry.window_dispatch

Low-level window property getters and method dispatchers for the PyTauri subprocess.

Dispatches window operations across eight categories: visibility, state, property setters, size/position, appearance, cursor, behavior, and webview methods. Phase 2 added start_dragging, set_skip_taskbar, set_icon, set_badge_count, and set_overlay_icon handlers.


pywry.window_dispatch.get_window_property

get_window_property(window: Window, prop: str, args: dict[str, Any] | None = None) -> Any

Get a specific property from a WebviewWindow.

Parameters:

Name Type Description Default
window Any

The WebviewWindow instance.

required
prop str

Property name to get.

required
args dict or None

Optional arguments for parameterised getters.

None

Returns:

Type Description
Any

The property value.

Raises:

Type Description
ValueError

If property name is unknown.

pywry.window_dispatch.call_window_method

call_window_method(window: Any, method: str, args: dict[str, Any]) -> Any

Call a specific method on a WebviewWindow.

Parameters:

Name Type Description Default
window Any

The WebviewWindow instance.

required
method str

Method name to call.

required
args dict[str, Any]

Dict with named parameters, e.g.: - {"title": "New Title"} for set_title - {"value": True} for boolean setters - {"width": 800, "height": 600} for set_size

required

Returns:

Type Description
Any

Method result (usually None for setters, value for getters).

Raises:

Type Description
ValueError

If method name is unknown.


Dispatch Categories

All dispatchable methods are grouped into these sets (exported for testing):

Category Examples
VISIBILITY_METHODS show, hide, set_focus, set_visible, start_dragging
STATE_METHODS minimize, maximize, unmaximize, toggle_maximize, set_fullscreen
PROPERTY_METHODS set_title, set_decorations, set_resizable, set_always_on_top, set_skip_taskbar
SIZE_POSITION_METHODS set_size, set_min_size, set_max_size, set_position, center
APPEARANCE_METHODS set_shadow, set_effects, set_progress_bar, set_icon, set_badge_count, set_overlay_icon
CURSOR_METHODS set_cursor_icon, set_cursor_position, set_cursor_visible, set_cursor_grab
BEHAVIOR_METHODS set_ignore_cursor_events, set_content_protected, request_user_attention, set_title_bar_style
WEBVIEW_METHODS navigate, eval, open_devtools, close_devtools, reload, zoom, print