Widgets¶
Base Class¶
-
class
gpi.widgets.
GenericWidgetGroup
(title, parent=None)[source]¶ This is the base-class for all widgets. It provides abstract methods and default behavior. From the node-developer’s perspective, this provides the widget-port, visibility, and collapsibility options.
-
getSettings
()[source]¶ These are the minimum settings required to re-instantiate each widget. Save all ‘get_<name>’ attributes as ‘<name>’. This list is also used in the GPI_PROCESS to buffer widget attributes.
-
set_collapsed
(col=True)[source]¶ bool | Only hide the ‘collapsable’ elements of a widget within its groupbox.
-
set_id
(value=None)[source]¶ int | INTERNAL USE ONLY: used for saving network information that will aid in reinstantiation.
-
set_quietval
(val)[source]¶ (same type as val) | Set the central value of a widget without triggering an event.
-
Numerical Controls¶
Selectors¶
-
class
gpi.widgets.
PushButton
(title, parent=None)[source]¶ A simple single pushbutton box.
str | Place a title, centered, on the button.
-
class
gpi.widgets.
ComboBox
(title, parent=None)[source]¶ Provides a popup list for different labels.
-
set_index
(index)[source]¶ int | gives the corresponding index of the chosen item, starting at 0. So, for example, self.getAttr(‘myfruitbox’,index) would return a 2 if ‘orange’ were selected from the item list given in this table, while self.getVal(‘myfruitbox’) would return the string ‘orange’.
-
-
class
gpi.widgets.
ExclusiveRadioButtons
(title, parent=None)[source]¶ Provides a set of check boxes for different labels. -Buttons are stacked.
list(str,str,…) | A list of labels (e.g. [‘b1’, ‘b2’,…]).
-
class
gpi.widgets.
ExclusivePushButtons
(title, parent=None)[source]¶ Provides a set of check boxes for different labels. -Buttons are placed side-by-side.
list(str,str,…) | A list of labels (e.g. [‘b1’, ‘b2’,…]).
Image Display¶
File Browsers¶
-
class
gpi.widgets.
OpenFileBrowser
(title, parent=None)[source]¶ Provide a QFileDialog() at the push of a button.
str | A title centered on the pushbutton (str).
str | Set browser title-bar (str).
Text Input/Output¶
-
class
gpi.widgets.
TextEdit
(title, parent=None)[source]¶ Provides an editable text window with scrollbar and python code syntax highlighting.