Bases: object
The Widget class is the base class for all glydget widgets. It provides the common set of method for the widgets including:
- selection methods
- methods to hide and and show widgets
- methods to manage size allocation and requests
- methods to deal with the widget’s place in the widget hierarchy
- event management methods
- methods to modify the style settings
Widget introduces style properties - these are basically object properties that are stored not on the object, but in the style object associated to the widget.
Known sub-classes:
Widget.show([batch, group]) | Show widget on screen. |
Widget.hide() | Hide widget. |
Widget.move(x, y) | Move widget to (x,y). |
Widget.resize(width, height) | Resize widget to (width, height). |
Widget.activate() | Activate widget. |
Widget.deactivate() | Deactivate widget. |
Widget.focus() | Focus widget. |
Widget.unfocus() | Unfocus widget. |
Widget.state | Widget current state. |
Widget.style | Style associated to the widget. |
Widget.size_request | Widget size request |
Widget.focusable | Indicate whether widget can be focused. |
Widget.activable | Indicate whether widget can be activated. |
Widget.focused | Indicate whether widget is currently focused. |
Widget.activated | Indicate whether widget is currently activated. |
Widget.expand | Widget propension to expand itself when possible. |
Widget.x | X coordinate of top-left corner. |
Widget.y | Y coordinate of top-left corner. |
Widget.width | Width in pixels. |
Widget.height | Height in pixels. |
Widget.parent | Parent container or None if the widget has no parent. |
Widget.root | Toplevel container or self if the widget has no parent. |
Widget.batch | Graphic batch where widget is currently in. |
Widget.group | Graphic group this widget belongs to. |
Show widget on screen.
Parameters: |
---|
Move widget to (x,y).
If widget is a toplevel widget, the move method actually moves the widget to the specified location. If widget is not a toplevel widget, the move method will move the whole hierarchy to a new location that will result in this widget being at the specified location.
Parameters: |
|
---|
Resize widget to (width, height).
Parameters: |
|
---|
Widget current state.
Style associated to the widget.
Type: | glydget.style.Style, read-write. |
---|
Indicate whether widget can be focused.
Type: | bool, read-write. |
---|
Indicate whether widget can be activated.
Type: | bool, read-write. |
---|
Indicate whether widget is currently focused.
Type: | bool, read-only. |
---|
Indicate whether widget is currently activated.
Type: | bool, read-only. |
---|
Widget propension to expand itself when possible.
Type: | [bool,bool] read-write. |
---|
X coordinate of top-left corner.
Type: | int, read-only. |
---|
Y coordinate of top-left corner.
Type: | int, read-only. |
---|
Width in pixels.
Type: | int, read-only. |
---|
Height in pixels.
Type: | int, read-only. |
---|
Parent container or None if the widget has no parent.
Type: | glydget.widget.Widget, read-only. |
---|
Toplevel container or self if the widget has no parent.
Type: | glydget.widget.Widget, read-only. |
---|
Graphic batch where widget is currently in.
Type: | pyglet.graphics.Batch, read-only. |
---|
Graphic group this widget belongs to.
Type: | pyglet.graphics.Group, read-only. |
---|