Page Contents

This Page

Window

class enaml.widgets.window.Window(parent=None, **kwargs)[source]

Bases: enaml.widgets.widget.Widget

A top-level Window component.

A Window component is represents of a top-level visible component with a frame decoration. It may have at most one child widget which is dubbed the ‘central widget’. The central widget is an instance of Container and is expanded to fit the size of the window.

A Window does not support features like MenuBars or DockPanes, for such functionality, use a MainWindow widget.

title = None

The titlebar text.

initial_size = None

The initial size of the window. A value of (-1, -1) indicates to let the client choose the initial size

modality = None

An enum which indicates the modality of the window. The default value is ‘non_modal’.

closed = None

An event fired when the window is closed.

central_widget = None

Returns the central widget in use for the Window

icon_source = None

The source url for the titlebar icon.

snapshot()[source]

Return the snapshot for a Window.

bind()[source]

A method called after initialization which allows the widget to bind any event handlers necessary.

on_action_closed(content)[source]

Handle the ‘closed’ action from the client widget.

close()[source]

Send the ‘close’ action to the client widget.

maximize()[source]

Send the ‘maximize’ action to the client widget.

minimize()[source]

Send the ‘minimize’ action to the client widget.

restore()[source]

Send the ‘restore’ action to the client widget.

__implements__

alias of __NoInterface__

Backends

Qt

Inheritance diagram of enaml.qt.qt_window.QtWindow

class enaml.qt.qt_window.QtWindow(object_id, parent, session)[source]

Bases: enaml.qt.qt_widget.QtWidget

A Qt implementation of an Enaml Window.

create_widget(parent, tree)[source]

Create the underlying QWindow object.

create(tree)[source]

Create and initialize the underlying widget.

init_layout()[source]

Perform layout initialization for the control.

activate()[source]

Activate the window.

central_widget()[source]

Find and return the central widget child for this widget.

Returns:result (QWidget or None) – The central widget defined for this widget, or None if one is not defined.
child_removed(child)[source]

Handle the child removed event for a QtWindow.

child_added(child)[source]

Handle the child added event for a QtWindow.

on_closed()[source]

The signal handler for the ‘closed’ signal.

on_action_close(content)[source]

Handle the ‘close’ action from the Enaml widget.

on_action_maximize(content)[source]

Handle the ‘maximize’ action from the Enaml widget.

on_action_minimize(content)[source]

Handle the ‘minimize’ action from the Enaml widget.

on_action_restore(content)[source]

Handle the ‘restore’ action from the Enaml widget.

on_action_set_icon_source(content)[source]

Handle the ‘set_icon_source’ action from the Enaml widget.

on_action_set_title(content)[source]

Handle the ‘set-title’ action from the Enaml widget.

close()[source]

Close the window

maximize()[source]

Maximize the window.

minimize()[source]

Minimize the window.

restore()[source]

Restore the window after a minimize or maximize.

set_icon_source(icon_source)[source]

Set the window icon source.

set_title(title)[source]

Set the title of the window.

set_initial_size(size)[source]

Set the initial size of the window.

set_visible(visible)[source]

Set the visibility on the window.

This is an overridden parent class method to set the visibility at a later time, so that layout can be initialized before the window is displayed.

Wx

Inheritance diagram of enaml.wx.wx_window.WxWindow

class enaml.wx.wx_window.WxWindow(object_id, parent, session)[source]

Bases: enaml.wx.wx_widget.WxWidget

A Wx implementation of an Enaml Window.

create_widget(parent, tree)[source]

Create the underlying wx.Frame widget.

create(tree)[source]

Create and initialize the window control.

init_layout()[source]

Perform layout initialization for the control.

central_widget()[source]

Find and return the central widget child for this widget.

Returns:result (wxWindos or None) – The central widget defined for this widget, or None if one is not defined.
child_removed(child)[source]

Handle the child removed event for a QtWindow.

child_added(child)[source]

Handle the child added event for a QtWindow.

on_close(event)[source]

The event handler for the EVT_CLOSE event.

on_layout_requested(event)[source]

Handle the layout request event from the central widget.

on_action_close(content)[source]

Handle the ‘close’ action from the Enaml widget.

on_action_maximize(content)[source]

Handle the ‘maximize’ action from the Enaml widget.

on_action_minimize(content)[source]

Handle the ‘minimize’ action from the Enaml widget.

on_action_restore(content)[source]

Handle the ‘restore’ action from the Enaml widget.

on_action_set_icon(content)[source]

Handle the ‘set-icon’ action from the Enaml widget.

on_action_set_title(content)[source]

Handle the ‘set-title’ action from the Enaml widget.

on_action_set_modality(content)[source]

Handle the ‘set-modality’ action from the Enaml widget.

close()[source]

Close the window

maximize()[source]

Maximize the window.

minimize()[source]

Minimize the window.

restore()[source]

Restore the window after a minimize or maximize.

set_icon(icon)[source]

Set the window icon.

set_title(title)[source]

Set the title of the window.

set_initial_size(size)[source]

Set the initial size of the window.

set_modality(modality)[source]

Set the modality of the window.

set_visible(visible)[source]

Set the visibility on the window.

This is an overridden parent class method to set the visibility at a later time, so that layout can be initialized before the window is displayed.