Skip to content

Application#

magicgui.application.Application #

Magicgui Application, wrapping a native BaseApplicationBackend implementation.

backend_module: ModuleType property #

Return module object that defines the backend.

backend_name: str property #

Return name of the GUI backend that this app wraps.

native: Any property #

Return the native GUI application instance.

__enter__() -> Application #

Context manager to start this application.

__exit__(*exc_details: Any) -> None #

Exit context manager for this application.

__repr__() -> str #

Return repr for this instance.

create() -> None #

Create the native application.

get_obj(name: str) -> Any #

Get the backend object for the given name (such as a widget).

process_events() -> None #

Process all pending GUI events.

quit() -> None #

Quit the native GUI event loop.

run() -> None #

Enter the native GUI event loop.

start_timer(interval: int = 1000, on_timeout: Callable[[], None] | None = None, single_shot: bool = False) -> None #

Start a timer with a given interval, optional callback, and single_shot.

magicgui.application.use_app(app: AppRef | None = None) -> Application #

Get/create the default Application object. See _use_app docstring.