================ Widget (hwx.gui) ================ Abstract base class for all widgets. ---------- Properties ---------- +------------------+------------------+------------------+ | active_ | advancedTooltip_ | children_ | +------------------+------------------+------------------+ | command_ | descendents_ | enabled_ | +------------------+------------------+------------------+ | font_ | height_ | helpTopic_ | +------------------+------------------+------------------+ | layout_ | maximumHeight_ | maximumWidth_ | +------------------+------------------+------------------+ | minimumHeight_ | minimumWidth_ | name_ | +------------------+------------------+------------------+ | parent_ | size_ | tooltip_ | +------------------+------------------+------------------+ | value_ | visible_ | width_ | +------------------+------------------+------------------+ -------------- 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 ---------------- .. _active: .. property:: active Returns True if it is visible and enabled, False otherwise. (readonly property) .. _advancedTooltip: .. property:: advancedTooltip The advanced tooltip that appears while hovering mouse over widget. .. _children: .. property:: children All widgets immediately contained by this one. .. _command: .. property:: command Method called when the widget is activated or changed. .. _descendents: .. property:: descendents All the widgets ultimately contained by this one. .. _enabled: .. property:: enabled The availability of the widget. Disabled widgets are greyed out and don't respond to input events. .. _font: .. property:: font The font used in this widget (set with font or dict). .. _height: .. property:: height Fixed height of the widget. .. _helpTopic: .. property:: helpTopic Popup web-browser helps when the user hits F1 when over this. Args: helptopic (str): Topic name user needs help in. .. _layout: .. property:: layout The layout that contains this widget's children. .. _maximumHeight: .. property:: maximumHeight The maximum allowable height inside the Layout. .. _maximumWidth: .. property:: maximumWidth The maximum allowable width inside the Layout. .. _minimumHeight: .. property:: minimumHeight The smallest allowable height inside the Layout. .. _minimumWidth: .. property:: minimumWidth The smallest allowable width inside the Layout. .. _name: .. property:: name The unique identifier within a container. .. _parent: .. property:: parent The container that owns this widget. .. _size: .. property:: size The fixed size of the widget (width, height). .. _tooltip: .. property:: tooltip The tooltip that appears while hovering mouse over widget. .. _value: .. property:: value The value of the widget. .. _visible: .. property:: visible The visibility of the widget. .. _width: .. 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: .. method:: 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: .. method:: destroy(self) Deletes this and all its children. .. _enableGlobalActions: .. method:: 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: .. method:: getMousePosition(self) Returns the mouse position. .. _getRelativeMousePosition: .. method:: getRelativeMousePosition(self) Returns the mouse position relative to this widget. .. _hide: .. method:: hide(self) Hides the widget. .. _saveAsPng: .. method:: 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: .. method:: 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: .. method:: setProperties(self, kwds) Internal method called from constructors. .. _show: .. method:: show(self) Shows the widget.