pyface.i_widget module¶
The base interface for all pyface widgets.
- class pyface.i_widget.IWidget(adaptee, default=<class 'traits.adaptation.adaptation_error.AdaptationError'>)[source]¶
Bases:
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
- tooltip = Str()¶
A tooltip for the widget.
An optional context menu for the widget.
- show(visible)[source]¶
Show or hide the widget.
- Parameters
visible (bool) – Visible should be
True
if the widget should be shown.
- enable(enabled)[source]¶
Enable or disable the widget.
- Parameters
enabled (bool) – The enabled state to set the widget to.
- has_focus()[source]¶
Does the widget currently have keyboard focus?
- Returns
focus_state – Whether or not the widget has keyboard focus.
- Return type
- class pyface.i_widget.MWidget[source]¶
Bases:
HasTraits
The mixin class that contains common code for toolkit specific implementations of the IWidget interface.
- tooltip = Str()¶
A tooltip for the widget.
An optional context menu for the widget.