View¶
Declaration¶
- class enamlnative.widgets.view.View(parent=None, **kwargs)[source]¶
Bases:
enaml.widgets.toolkit_object.ToolkitObject
View is a view group that displays child views in relative positions.
- enabled¶
Widget is enabled
- visible¶
Show or hide
- clickable¶
Observe click events
- long_clickable¶
Set whether the view can be long clicked
- focusable¶
Set whether the view can be focused
- key_events¶
Observe key events
- touch_events¶
Observe touch events
- clicked¶
Called when view is clicked
- long_clicked¶
Called when view is clicked
- key_event¶
Called when a key event occurs
- touch_event¶
Called when a touch event occurs
- deactivated¶
Called when the view is about to be destroyed
- animations¶
Animations
- alpha¶
Foreground alpha
- style¶
Initial widget style
- background_style¶
Background style
- background_color¶
Background color
- width¶
Width and height or a string “match_parent” or “fill_parent”
- gravity¶
Layout gravity
- position¶
The Position property tells Flexbox how you want your item to be positioned within its parent.
- align_self¶
How to align children along the cross axis of their container
- flex_basis¶
The FlexBasis property is an axis-independent way of providing the default size of an item on the main axis. Setting the FlexBasis of a child is similar to setting the Width of that child if its parent is a container with FlexDirection = row or setting the Height of a child if its parent is a container with FlexDirection = column. The FlexBasis of an item is the default size of that item, the size of the item before any FlexGrow and FlexShrink calculations are performed.
- proxy¶
A reference to the ProxyLabel object.
Android Implementation¶
- class enamlnative.android.android_view.AndroidView[source]¶
Bases:
enamlnative.android.android_toolkit_object.AndroidToolkitObject
,enamlnative.widgets.view.ProxyView
An Android implementation of an Enaml ProxyView.
- widget¶
A reference to the widget created by the proxy.
- dp¶
Display metrics density
- layout_param_type¶
Layout type
- layout_params¶
Layout params
- default_layout¶
Default layout params
- init_widget()[source]¶
Initialize the underlying widget.
This reads all items declared in the enamldef block for this node and sets only the values that have been specified. All other values will be left as default. Doing it this way makes atom to only create the properties that need to be overridden from defaults thus greatly reducing the number of initialization checks, saving time and memory.
If you don’t want this to happen override get_declared_keys to return an empty list.
- get_declared_items()[source]¶
Get the members that were set in the enamldef block for this Declaration. Layout keys are grouped together until the end so as to avoid triggering multiple updates.
- Returns
result – List of keys and values
- Return type
List of (k,v) pairs that were defined for this widget in enaml
- set_layout(layout)[source]¶
Sets the LayoutParams of this widget.
Since the available properties that may be set for the layout params depends on the parent, actual creation of the params is delegated to the parent
- Parameters
layout (Dict) – A dict of layout parameters the parent should used to layout this child. The widget defaults are updated with user passed values.
- update_layout(**params)[source]¶
Updates the LayoutParams of this widget.
This delegates to the parent and expects the parent to update the existing layout without recreating it.
- Parameters
params (Dict) – A dict of layout parameters the parent should used to layout this child. The widget defaults are updated with user passed values.
- create_layout_params(child, layout)[source]¶
Create the LayoutParams for a child with it’s requested layout parameters. Subclasses should override this as needed to handle layout specific needs.
- Parameters
- Returns
layout_params – A LayoutParams bridge object with the requested layout options.
- Return type
LayoutParams
No iOS implementation found.