Widget (hwx.gui)

Abstract base class for all widgets.

Properties

Public Methods

addChildren (self, children)

destroy (self)

enableGlobalActions (self, enable)

getMousePosition (self)

getRelativeMousePosition (self)

hide (self)

saveAsPng (self, fname)

setF1HelpTopic (self, helptopic)

setProperties (self, kwds)

show (self)

Property Details

property active

Returns True if it is visible and enabled, False otherwise. (readonly property)

property advancedTooltip

The advanced tooltip that appears while hovering mouse over widget.

property children

All widgets immediately contained by this one.

property command

Method called when the widget is activated or changed.

property descendents

All the widgets ultimately contained by this one.

property enabled

The availability of the widget.

Disabled widgets are greyed out and don’t respond to input events.

property font

The font used in this widget (set with font or dict).

property height

Fixed height of the widget.

property layout

The layout that contains this widget’s children.

property maximumHeight

The maximum allowable height inside the Layout.

property maximumWidth

The maximum allowable width inside the Layout.

property minimumHeight

The smallest allowable height inside the Layout.

property minimumWidth

The smallest allowable width inside the Layout.

property name

The unique identifier within a container.

property parent

The container that owns this widget.

property size

The fixed size of the widget (width, height).

property tooltip

The tooltip that appears while hovering mouse over widget.

property value

The value of the widget.

property visible

The visibility of the widget.

property width

The fixed width of the widget.

If a string or list of strings are specified, the width will be calculated from the longest string given the font.

Method Details

addChildren(self, children)

Add child widgets/layouts into this widget.

Widget children get layed out using a VBoxLayout.

Typically, you’ll pass the parent/children into the constructor instead of calling this function directly.

param children

type children

list[Widget] | Layout

destroy(self)

Deletes this and all its children.

enableGlobalActions(self, enable)

Sets the state of Global Actions.

Disable the global actions to get key events.

param enable

Determines whether to enable or disable global actions.

type enable

bool

getMousePosition(self)

Returns the mouse position.

getRelativeMousePosition(self)

Returns the mouse position relative to this widget.

hide(self)

Hides the widget.

saveAsPng(self, fname)

Saves the widget as a .png file.

param fname

The file name for the .png

type fname

str

returns

True if it was saved succesfully, False otherwise.

rtype

bool

setF1HelpTopic(self, helptopic)

Popup web-browser helps when the user hits F1 when over this.

param helptopic

Topic name user needs help in.

type helptopic

str

setProperties(self, kwds)

Internal method called from constructors.

show(self)

Shows the widget.