enaml.widgets.raw_widget

Classes

RawWidget

A raw toolkit-specific control.

class enaml.widgets.raw_widget.RawWidget(parent=None, **kwargs)[source]

Bases: enaml.widgets.control.Control

A raw toolkit-specific control.

Use this widget when the toolkit backend for the application is known ahead of time, and Enaml does provide an implementation of the required widget. This can be used as a hook to inject custom widgets into an Enaml widget hierarchy.

Notes

When using the Qt backend, note that PySide requires weakrefs for using bound methods as slots. PyQt doesn’t, but executes unsafe code if not using weakrefs. So you should add the following line to your class. __slots__ = (‘__weakref__’,)

proxy

A reference to the proxy Control object.

create_widget(parent)[source]

Create the toolkit widget for the control.

This method should create and initialize the widget.

Parameters

parent (toolkit widget or None) – The parent toolkit widget for the control.

Returns

result – The toolkit specific widget for the control.

Return type

toolkit widget

get_widget()[source]

Retrieve the toolkit widget for the control.

Returns

result – The toolkit widget that was previously created by the call to ‘create_widget’ or None if the proxy is not active or the widget has been destroyed.

Return type

toolkit widget or None