Page Contents

This Page

Label

class enaml.widgets.label.Label(parent=None, **kwargs)[source]

Bases: enaml.widgets.control.Control

A simple control for displaying read-only text.

text = None

The text for the label.

align = None

The horizontal alignment of the text in the widget area.

vertical_align = None

The vertical alignment of the text in the widget area.

hug_width = None

How strongly a component hugs it’s content. Labels hug their contents’ width weakly by default.

snapshot()[source]

Returns the dict of creation attributes for the control.

bind()[source]

A method called after initialization which allows the widget to bind any event handlers necessary.

Backends

Qt

digraph inheritance252dfe23f7 { rankdir=LR; width=8.0; ratio=compress; fontsize=14; size="8.0, 12.0"; "QtWidget" [style="setlinewidth(0.5)",URL="enaml.widgets.widget.Widget.html#enaml.qt.qt_widget.QtWidget",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "QtObject" -> "QtWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QtConstraintsWidget" [style="setlinewidth(0.5)",URL="enaml.widgets.constraints_widget.ConstraintsWidget.html#enaml.qt.qt_constraints_widget.QtConstraintsWidget",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "QtWidget" -> "QtConstraintsWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QtObject" [shape=box,style="setlinewidth(0.5)",fontsize=10,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25]; "QtLabel" [style="setlinewidth(0.5)",URL="#enaml.qt.qt_label.QtLabel",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "QtControl" -> "QtLabel" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QtControl" [style="setlinewidth(0.5)",URL="enaml.widgets.control.Control.html#enaml.qt.qt_control.QtControl",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "QtConstraintsWidget" -> "QtControl" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

class enaml.qt.qt_label.QtLabel(object_id, parent, session)[source]

Bases: enaml.qt.qt_control.QtControl

A Qt implementation of an Enaml Label.

create_widget(parent, tree)[source]

Create the underlying label widget.

create(tree)[source]

Create and initialize the underlying widget.

on_action_set_text(content)[source]

Handle the ‘set_text’ action from the Enaml widget.

on_action_set_align(content)[source]

Handle the ‘set_align’ action from the Enaml widget.

on_action_set_vertical_align(content)[source]

Handle the ‘set_vertical_align’ action from the Enaml widget.

set_text(text)[source]

Set the text in the underlying widget.

set_align(align)[source]

Set the alignment of the text in the underlying widget.

set_vertical_align(align)[source]

Set the vertical alignment of the text in the underlying widget.

Wx

digraph inheritance689e94ec99 { rankdir=LR; width=8.0; ratio=compress; fontsize=14; size="8.0, 12.0"; "WxConstraintsWidget" [style="setlinewidth(0.5)",URL="enaml.widgets.constraints_widget.ConstraintsWidget.html#enaml.wx.wx_constraints_widget.WxConstraintsWidget",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "WxWidget" -> "WxConstraintsWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "WxWidget" [style="setlinewidth(0.5)",URL="enaml.widgets.widget.Widget.html#enaml.wx.wx_widget.WxWidget",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "WxObject" -> "WxWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "WxControl" [style="setlinewidth(0.5)",URL="enaml.widgets.control.Control.html#enaml.wx.wx_control.WxControl",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "WxConstraintsWidget" -> "WxControl" [arrowsize=0.5,style="setlinewidth(0.5)"]; "WxObject" [shape=box,style="setlinewidth(0.5)",fontsize=10,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25]; "WxLabel" [style="setlinewidth(0.5)",URL="#enaml.wx.wx_label.WxLabel",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "WxControl" -> "WxLabel" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

class enaml.wx.wx_label.WxLabel(object_id, parent, session)[source]

Bases: enaml.wx.wx_control.WxControl

A Wx implementation of an Enaml Label.

create_widget(parent, tree)[source]

Create the underlying wx.StaticText widget.

create(tree)[source]

Create and initialize the label control.

on_action_set_text(content)[source]

Handle the ‘set_text’ action from the Enaml widget.

on_action_set_align(content)[source]

Handle the ‘set_align’ action from the Enaml widget.

on_action_set_vertical_align(content)[source]

Handle the ‘set_vertical_align’ action from the Enaml widget.

set_text(text)[source]

Set the text in the underlying widget.

set_align(align)[source]

Set the alignment of the text in the underlying widget.

set_vertical_align(align)[source]

Set the vertical alignment of the text in the underlying widget.