edifice.Window

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

Bases: edifice._component.RootComponent

Component that displays its child as a window.

Window will mount its child as a window. It can be created as a child of any standard container. This is useful if a window is logically associated with

class MyApp(Component):

    def render(self):
        return View()(
            Window(Label("Hello"), title="Hello"),
        )

if __name__ == "__main__":
    App(MyApp()).start()
Parameters
  • title (str) – the window title

  • icon (Union[str, Sequence, None]) – the window icon

  • 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], Any]]) – event handler for when this window is closed.

Methods

will_unmount()

Callback function that is called when the component will unmount.

Attributes

children

The children of this component.

props

The props of this component.