edifice.Window

edifice.Window#

class edifice.Window(title='Edifice Application', icon=None, menu=None, on_close=None, **kwargs)[source]#

Bases: View

The root View element of an App which runs in an operating system window.

The children of this Window are the visible Elements of the App. When this Window closes, all of the children are unmounted and then the App stops.

Parameters:
  • title (str) – The window title.

  • icon (Union[str, Sequence, None]) – The window icon image.

  • menu – The window’s menu bar. In some GUI settings, for example Mac OS, this menu will appear seperately from the window.

  • on_close (Optional[Callable[[QCloseEvent], Optional[Awaitable[None]]]]) – Event handler for when this window is closing. This event handler will fire before the children are unmounted.

Methods

__init__([title, icon, menu, on_close])

register_ref(reference)

Registers provided Reference to this Element.

set_key(key)

Sets the key of the Element.

Attributes

children

The children of this Element.

props

The props of this Element.

underlying

The underlying QWidget, which may not exist if this Element has not rendered.