Page Contents

This Page

Widget

class enaml.widgets.widget.Widget(parent=None, **kwargs)[source]

Bases: enaml.core.messenger.Messenger

The base class of all visible widgets in Enaml.

enabled = None

Whether or not the widget is enabled.

visible = None

Whether or not the widget is visible.

show_focus_rect = None

A flag indicating whether or not to show the focus rectangle for the given widget. This is not necessarily support by all widgets on all clients. A value of None indicates to use the default as supplied by the client.

bgcolor = None

The background color of the widget. Supports CSS3 color strings.

fgcolor = None

The foreground color of the widget. Supports CSS3 color strings.

font = None

The font used for the widget. Supports CSS font formats.

minimum_size = None

The minimum size for the widget. The default means that the client should determine an intelligent minimum size.

maximum_size = None

The maximum size for the widget. The default means that the client should determine and inteliigent maximum size.

bind()[source]

Bind the change handlers for a widget component.

__implements__

alias of __NoInterface__

Backends

Qt

Inheritance diagram of enaml.qt.qt_widget.QtWidget

class enaml.qt.qt_widget.QtWidget(object_id, parent, session)[source]

Bases: enaml.qt.qt_object.QtObject

A Qt4 implementation of an Enaml Widget.

create_widget(parent, tree)[source]

Creates the underlying QWidget object.

create(tree)[source]

Create and initialize the underlying widget.

widget_item()[source]

Get the QWidgetItem for the underlying widget.

Returns:result (QWidgetItem) – The QWidgetItem to use for the underlying widget.
on_action_set_enabled(content)[source]

Handle the ‘set_enabled’ action from the Enaml widget.

on_action_set_visible(content)[source]

Handle the ‘set_visible’ action from the Enaml widget.

on_action_set_bgcolor(content)[source]

Handle the ‘set_bgcolor’ action from the Enaml widget.

on_action_set_fgcolor(content)[source]

Handle the ‘set_fgcolor’ action from the Enaml widget.

on_action_set_font(content)[source]

Handle the ‘set_font’ action from the Enaml widget.

on_action_set_minimum_size(content)[source]

Handle the ‘set_minimum_size’ action from the Enaml widget.

on_action_set_maximum_size(content)[source]

Handle the ‘set_maximum_size’ action from the Enaml widget.

on_action_set_show_focus_rect(content)[source]

Handle the ‘set_show_focus_rect’ action from the Enaml widget.

set_minimum_size(min_size)[source]

Sets the minimum size on the underlying widget.

Parameters:min_size ((int, int)) – The minimum size allowable for the widget. A value of (-1, -1) indicates the default min size.
set_maximum_size(max_size)[source]

Sets the maximum size on the underlying widget.

Parameters:max_size ((int, int)) – The minimum size allowable for the widget. A value of (-1, -1) indicates the default max size.
set_enabled(enabled)[source]

Set the enabled state on the underlying widget.

Parameters:enabled (bool) – Whether or not the widget is enabled.
set_visible(visible)[source]

Set the visibility state on the underlying widget.

Parameters:visible (bool) – Whether or not the widget is visible.
set_bgcolor(bgcolor)[source]

Set the background color on the underlying widget.

Parameters:bgcolor (str) – The background color of the widget as a CSS color string.
set_fgcolor(fgcolor)[source]

Set the foreground color on the underlying widget.

Parameters:fgcolor (str) – The foreground color of the widget as a CSS color string.
set_font(font)[source]

Set the font on the underlying widget.

Parameters:font (str) – The font for the widget as a CSS font string.
set_show_focus_rect(show)[source]

Sets whether or not to show the focus rectangle around the widget. This is currently only supported on OSX.

Wx

Inheritance diagram of enaml.wx.wx_widget.WxWidget

class enaml.wx.wx_widget.WxWidget(object_id, parent, session)[source]

Bases: enaml.wx.wx_object.WxObject

A Wx implementation of an Enaml WidgetComponent.

create_widget(parent, tree)[source]

Creates the underlying wx.Panel widget.

create(tree)[source]

Create and initialize the widget control.

update_geometry()[source]

Notify the layout system that this widget has changed.

This method should be called when the geometry of the widget has changed and the layout system should update the layout. This will post a wxEvtLayoutRequested event to the parent of this widget.

on_action_set_enabled(content)[source]

Handle the ‘set_enabled’ action from the Enaml widget.

on_action_set_visible(content)[source]

Handle the ‘set_visible’ action from the Enaml widget.

on_action_set_bgcolor(content)[source]

Handle the ‘set_bgcolor’ action from the Enaml widget.

on_action_set_fgcolor(content)[source]

Handle the ‘set_fgcolor’ action from the Enaml widget.

on_action_set_font(content)[source]

Handle the ‘set_font’ action from the Enaml widget.

on_action_set_minimum_size(content)[source]

Handle the ‘set_minimum_size’ action from the Enaml widget.

on_action_set_maximum_size(content)[source]

Handle the ‘set_maximum_size’ action from the Enaml widget.

on_action_set_show_focus_rect(content)[source]

Handle the ‘set_show_focus_rect’ action from the Enaml widget.

set_minimum_size(min_size)[source]

Sets the minimum size on the underlying widget.

Parameters:min_size ((int, int)) – The minimum size allowable for the widget. A value of (-1, -1) indicates the default min size.
set_maximum_size(max_size)[source]

Sets the maximum size on the underlying widget.

Parameters:max_size ((int, int)) – The minimum size allowable for the widget. A value of (-1, -1) indicates the default max size.
set_enabled(enabled)[source]

Set the enabled state on the underlying widget.

Parameters:enabled (bool) – Whether or not the widget is enabled.
set_visible(visible)[source]

Set the visibility state on the underlying widget.

Parameters:visible (bool) – Whether or not the widget is visible.
set_bgcolor(bgcolor)[source]

Set the background color on the underlying widget.

Parameters:bgcolor (str) – The background color of the widget as a CSS color string.
set_fgcolor(fgcolor)[source]

Set the foreground color on the underlying widget.

Parameters:fgcolor (str) – The foreground color of the widget as a CSS color string.
set_font(font)[source]

Set the font on the underlying widget.

Parameters:font (str) – The font for the widget as a CSS font string.
set_show_focus_rect(show)[source]

Sets whether or not to show the focus rectangle around the widget.

This is currently not supported on Wx.