pyface.i_widget module

The base interface for all pyface widgets.

class pyface.i_widget.IWidget

Bases: traits.has_traits.Interface

The base interface for all pyface widgets.

Pyface widgets delegate to a toolkit specific control.

control = Any()

The toolkit specific control that represents the widget.

parent = Any()

The control’s optional parent control.

visible = Bool(True)

Whether or not the control is visible

enabled = Bool(True)

Whether or not the control is enabled

show(visible)

Show or hide the widget.

Parameters

visible (bool) – Visible should be True if the widget should be shown.

enable(enabled)

Enable or disable the widget.

Parameters

enabled (bool) – The enabled state to set the widget to.

create()

Creates the toolkit specific control.

This method should create the control and assign it to the :py:attr:control trait.

destroy()

Destroy the control if it exists.

class pyface.i_widget.MWidget

Bases: traits.has_traits.HasTraits

The mixin class that contains common code for toolkit specific implementations of the IWidget interface.

create()

Creates the toolkit specific control.

The default implementation simply calls _create()