You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In more recent Widget classes we are finding a pattern that works for creation of:
the _create method calls _create_control which creates the main toolkit control, possibly with some minimal configuration and setting of options that always apply and sets the result into the control attribute.
in some cases there are method calls to create associated widgets or sub-widgets for complex widgets
the _create method calls _initialize_control to configure the initial state of control properties that may vary
the _create method calls _add_event_listeners which connects traits observers which need ui dispatch, and binds callbacks for toolkit events (and signals, etc. in Qt).
Some of these should call super() to ensure that creation methods from the superclass get done correctly.
There is a corresponding (although usually simpler) stack of things to be done at widget destruction time.
Many older, particularly Wx, widgets don't follow this pattern. Some effort should be put into standardizing things to facilitate subclassing, etc.
The text was updated successfully, but these errors were encountered:
In more recent
Widget
classes we are finding a pattern that works for creation of:_create
method calls_create_control
which creates the main toolkit control, possibly with some minimal configuration and setting of options that always apply and sets the result into thecontrol
attribute._create
method calls_initialize_control
to configure the initial state of control properties that may vary_create
method calls_add_event_listeners
which connects traits observers which need ui dispatch, and binds callbacks for toolkit events (and signals, etc. in Qt).Some of these should call
super()
to ensure that creation methods from the superclass get done correctly.There is a corresponding (although usually simpler) stack of things to be done at widget destruction time.
Many older, particularly Wx, widgets don't follow this pattern. Some effort should be put into standardizing things to facilitate subclassing, etc.
The text was updated successfully, but these errors were encountered: