Style¶
-
structure
Style¶ This object represents the style of a widget. Styles can be either changed directly on a
Widget, or changed on the GUI:SKIN so as to affect all subsequently created widgets of a particular type inside that GUI.Suffix Type Description HSTRETCHBooleanShould the widget stretch horizontally? (default depends on widget subclass) VSTRETCHBooleanShould the widget stretch vertically? WIDTHscalar(pixels)Fixed width (or 0 if flexible). HEIGHTscalar(pixels)Fixed height (or 0 if flexible). MARGINStyleRectOffsetSpacing between this and other widgets. PADDINGStyleRectOffsetSpacing between the outside of the widget and its contents (text, etc.). BORDERStyleRectOffsetSize of the edges in the 9-slice image for BG images in NORMAL, HOVER, etc. OVERFLOWStyleRectOffsetExtra space added to the area of the background image. Allows the background to go beyond the widget’s rectangle. ALIGNstringOne of “CENTER”, “LEFT”, or “RIGHT”. See note below. FONTstringThe name of the font of the text on the content or “” if the default. FONTSIZEscalarThe size of the text on the content. RICHTEXTBooleanSet to False to disable rich-text (<i>...</i>, etc.) NORMALStyleStateProperties for the widget normally. ONStyleStateProperties for when the widget is under the mouse and “on”. NORMAL_ONStyleStateAlias for ON. HOVERStyleStateProperties for when the widget is under the mouse. HOVER_ONStyleStateProperties for when the widget is under the mouse and “on”. ACTIVEStyleStateProperties for when the widget is active (eg. button being held down). ACTIVE_ONStyleStateProperties for when the widget is active and “on”. FOCUSEDStyleStateProperties for when the widget has keyboard focus. FOCUSED_ONStyleStateProperties for when the widget has keyboard focus and is “on”. BGstringThe same as NORMAL:BG. Name of a “9-slice” image file. TEXTCOLORColor The same as NORMAL:TEXTCOLOR. The color of the text on the label. -
Style:
HSTRETCH¶ Type: BooleanAccess: Get/Set Should the widget stretch horizontally? (default depends on widget subclass)
-
Style:
MARGIN¶ Type: StyleRectOffsetAccess: Get/Set Spacing between this and other widgets.
-
Style:
PADDING¶ Type: StyleRectOffsetAccess: Get/Set Spacing between the outside of the widget and its contents (text, etc.).
-
Style:
BORDER¶ Type: StyleRectOffsetAccess: Get/Set Size of the edges in the 9-slice image for BG images in NORMAL, HOVER, etc.
-
Style:
OVERFLOW¶ Type: StyleRectOffsetAccess: Get/Set Extra space added to the area of the background image. Allows the background to go beyond the widget’s rectangle.
Note
The ALIGN attribute will not do anything useful unless either HSTRETCH is set to true or a fixed WIDTH is set, since otherwise it will be exactly the right size to fit the content of the widget with no alignment within that space being necessary.
It is currently only relevant for the widgets that have scalar content (Label and subclasses).
-
Style:
FONT¶ Type: stringAccess: Get/Set The name of the font of the text on the content or “” if the default.
-
Style:
NORMAL¶ Type: StyleStateAccess: Get/Set Properties for the widget normally.
-
Style:
ON¶ Type: StyleStateAccess: Get/Set Properties for when the widget is under the mouse and “on”.
-
Style:
NORMAL_ON¶ Type: StyleStateAccess: Get/Set Alias for ON.
-
Style:
HOVER¶ Type: StyleStateAccess: Get/Set Properties for when the widget is under the mouse.
-
Style:
HOVER_ON¶ Type: StyleStateAccess: Get/Set Properties for when the widget is under the mouse and “on”.
-
Style:
ACTIVE¶ Type: StyleStateAccess: Get/Set Properties for when the widget is active (eg. button being held down).
-
Style:
ACTIVE_ON¶ Type: StyleStateAccess: Get/Set Properties for when the widget is active and “on”.
-
Style:
FOCUSED¶ Type: StyleStateAccess: Get/Set Properties for when the widget has keyboard focus.
-
Style:
FOCUSED_ON¶ Type: StyleStateAccess: Get/Set Properties for when the widget has keyboard focus and is “on”.
-
Style:
TEXTCOLOR¶ Type: colorThe same as NORMAL:TEXTCOLOR. The color of the text on the label.
-
Style: