==================== ButtonBase (hwx.gui) ==================== Abstract base class for all buttons. Inherits: - :ref:`Widget (hwx.gui)` ---------- Properties ---------- +-------------+-------------+-------------+ | accel_ | autoRepeat_ | checkable_ | +-------------+-------------+-------------+ | checked_ | dialog_ | flat_ | +-------------+-------------+-------------+ | icon_ | text_ | | +-------------+-------------+-------------+ -------------- 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 ---------------- .. _accel: .. property:: accel Keyboard accelerator to execute the command (ie 'Ctrl-r'). .. _autoRepeat: .. property:: autoRepeat Returns and sets if button will auto-repeat if the user holds it down. .. _checkable: .. property:: checkable Returns and sets if button can be toggled/checked (depending on rendering) .. _checked: .. property:: checked Returns and sets if button has been toggled/checked. Only works if it is checkable. .. _dialog: .. property:: dialog (type[ActionDialog]) Dialog toggled by button. The dialog is accessed/created through its cls.get() classmethod. .. _flat: .. property:: flat Returns and sets if button has a flat borderless appearance. .. _icon: .. property:: icon Icon file name. .. _text: .. property:: text Text to display. -------------- 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) Ensure proper order of setting properties. :param kwds: A dict so the order of the properties are set is unpredictable checkable must be set before checked, or checked will not take effect. .. _show: .. method:: show(self) Shows the widget.