# Class e.p.p.w.w.Widget(Group):

Part of elisa.plugins.pigment.widgets.widget View In Hierarchy

Known subclasses: elisa.plugins.database.scanning_widget.ScannerWidget, elisa.plugins.pigment.widgets.button.Button, elisa.plugins.pigment.widgets.entry.Entry, elisa.plugins.pigment.widgets.label.Label, elisa.plugins.pigment.widgets.list.List, elisa.plugins.pigment.widgets.osk.Button, elisa.plugins.pigment.widgets.osk.OnScreenKeyboard, elisa.plugins.pigment.widgets.range.Range, elisa.plugins.poblesec.base.grid.GridItem, elisa.plugins.poblesec.base.preview_list.PreviewWidget, elisa.plugins.poblesec.base.preview_list.Shortcut, elisa.plugins.poblesec.login_settings_controller.ReturnButton, elisa.plugins.poblesec.player_video.PlayerOsd, elisa.plugins.poblesec.player_video.PlayerOsdExit, elisa.plugins.poblesec.player_video.PlayerOsdStatus, elisa.plugins.poblesec.poblesec_browser_controller.BottomBar, elisa.plugins.poblesec.poblesec_browser_controller.BreadCrumbs, elisa.plugins.poblesec.poblesec_browser_controller.Crumb, elisa.plugins.poblesec.poblesec_browser_controller.TopBar, elisa.plugins.poblesec.poblesec_browser_controller.TopBarButton, elisa.plugins.poblesec.poblesec_browser_controller.TopBarWithBreadCrumbs, elisa.plugins.poblesec.popup.PopupWidget, elisa.plugins.poblesec.sections_menu.SectionItemWidget, elisa.plugins.poblesec.widgets.button.StateButton, elisa.plugins.poblesec.widgets.entry.EntryBar, elisa.plugins.poblesec.widgets.image_with_reflection.ImageWithReflection, elisa.plugins.poblesec.widgets.long_loading_image.LongLoadingImage, elisa.plugins.poblesec.widgets.menu_item.MenuItemWidget, elisa.plugins.poblesec.widgets.nothing_to_display.NothingToDisplay, elisa.plugins.poblesec.widgets.search_results.SearchResultEntryWidget, elisa.plugins.poblesec.widgets.search_results.SearchResultWidget, elisa.plugins.poblesec.widgets.selector.ActionSelector, elisa.plugins.poblesec.widgets.sliced_image.SlicedImageHorizontal, elisa.plugins.shelf.shelf_controller.PluginWidget, elisa.plugins.shelf.shelf_controller.ShelfHeader, elisa.plugins.weather.report_widget.WeatherWidget

Basic widget for the python Pigment scenegraph.

It handles a simple focus system (at most one widget having the focus at one time) and a simple style system (with style and style-properties change notifications, also bound to state changes).

Emit these signals:

- focus
- state-changed
- style-set
- key-press-event

Instance Variables | name | the name of the widget (type: string )
| style | the present style of the widget (type: `pgm.widget.Style` )
| state | the present state of the widget (type: enum(STATE_NORMAL, STATE_ACTIVE, STATE_PRELIGHT, STATE_SELECTED, STATE_INSENSITIVE) )

Line # | Kind | Name | Docs
--- | --- | --- | ---
69 | Method | __init__ | Set the default styles for the widget. Subclasses should override and
132 | Method | state__get | The present state of the widget
136 | Method | state__set | Set the state of the widget and emit the "state-changed" signal if
152 | Method | do_state_changed | Default 'state-changed' handler
159 | Method | style__get | The present style
163 | Method | style__set | Set the present style, after binding it to the widget and subscribing
183 | Method | do_style_set | Default 'style-set' signal handler
205 | Method | get_parent | Get the parent, if exists.
213 | Method | get_children | Get the list of direct children.
221 | Method | get_root | Get the root of the widget's tree hierarchy
232 | Method | get_descendants | Get the list of nodes in the subtree
246 | Method | focus__get | Whether the widget has focus
250 | Method | focus__set | Set or unset the focus on the widget and emit the 'focus' signal.
278 | Method | focus_child__get | Get the child with focus
286 | Method | do_key_press_event | Default 'key-press-event' signal handler.
349 | Class Method | demo | Create a demo widget, put it on a canvas and show it in a viewport.

Inherited from Group:

Line # | Kind | Name | Docs
--- | --- | --- | ---
66 | Method | canvas__set | Undocumented
86 | Method | canvas__get | Undocumented
91 | Method | layer__set | Undocumented
104 | Method | layer__get | Undocumented
112 | Method | add | Undocumented
134 | Method | _proxy_child_signal_scrolled | Undocumented
138 | Method | _proxy_child_signal | Undocumented
142 | Method | _proxy_child_signal_with_pressure | Undocumented
146 | Method | remove | Undocumented
160 | Method | empty | Undocumented
170 | Method | __len__ | Undocumented
173 | Method | __iter__ | Undocumented
176 | Method | update_absolute_x | Undocumented
181 | Method | update_absolute_y | Undocumented
186 | Method | update_absolute_z | Undocumented
191 | Method | update_absolute_position | Undocumented
196 | Method | update_absolute_width | Undocumented
203 | Method | update_absolute_height | Undocumented
210 | Method | update_absolute_size | Undocumented
217 | Method | update_absolute_visible | Undocumented
222 | Method | update_absolute_opacity | Undocumented
228 | Method | regenerate | Undocumented
232 | Method | absolute_width__get | Undocumented
235 | Method | absolute_width__set | Undocumented
240 | Method | absolute_height__get | Undocumented
243 | Method | absolute_height__set | Undocumented
248 | Method | absolute_x__get | Undocumented
251 | Method | absolute_x__set | Undocumented
257 | Method | absolute_y__get | Undocumented
260 | Method | absolute_y__set | Undocumented
266 | Method | absolute_z__get | Undocumented
269 | Method | absolute_z__set | Undocumented
275 | Method | clean | Undocumented

Inherited from Node (via Group):

Line # | Kind | Name | Docs
--- | --- | --- | ---
36 | Method | parent__set | Undocumented
55 | Method | parent__get | Undocumented
60 | Method | x__get | Undocumented
66 | Method | x__set | Undocumented
82 | Method | y__get | Undocumented
88 | Method | y__set | Undocumented
105 | Method | z__get | Undocumented
111 | Method | z__set | Undocumented
128 | Method | position__get | Undocumented
134 | Method | position__set | Undocumented
158 | Method | width__get | Undocumented
164 | Method | width__set | Undocumented
182 | Method | height__get | Undocumented
188 | Method | height__set | Undocumented
208 | Method | size__get | Undocumented
214 | Method | size__set | Undocumented
234 | Method | visible__get | Undocumented
240 | Method | visible__set | Undocumented
258 | Method | opacity__get | Undocumented
264 | Method | opacity__set | Undocumented

def __init__(self):
overrides elisa.plugins.pigment.graph.group.Group.__init__
overridden in elisa.plugins.database.scanning_widget.ScannerWidget, elisa.plugins.pigment.widgets.button.Button, elisa.plugins.pigment.widgets.entry.Entry, elisa.plugins.pigment.widgets.label.Label, elisa.plugins.pigment.widgets.list.List, elisa.plugins.pigment.widgets.osk.Button, elisa.plugins.pigment.widgets.osk.OnScreenKeyboard, elisa.plugins.pigment.widgets.range.Range, elisa.plugins.poblesec.base.grid.GridItem, elisa.plugins.poblesec.base.preview_list.PreviewWidget, elisa.plugins.poblesec.base.preview_list.Shortcut, elisa.plugins.poblesec.login_settings_controller.ReturnButton, elisa.plugins.poblesec.player_video.PlayerOsd, elisa.plugins.poblesec.player_video.PlayerOsdExit, elisa.plugins.poblesec.player_video.PlayerOsdStatus, elisa.plugins.poblesec.poblesec_browser_controller.BottomBar, elisa.plugins.poblesec.poblesec_browser_controller.BreadCrumbs, elisa.plugins.poblesec.poblesec_browser_controller.Crumb, elisa.plugins.poblesec.poblesec_browser_controller.TopBar, elisa.plugins.poblesec.poblesec_browser_controller.TopBarButton, elisa.plugins.poblesec.poblesec_browser_controller.TopBarWithBreadCrumbs, elisa.plugins.poblesec.popup.PopupWidget, elisa.plugins.poblesec.sections_menu.SectionItemWidget, elisa.plugins.poblesec.widgets.button.StateButton, elisa.plugins.poblesec.widgets.entry.EntryBar, elisa.plugins.poblesec.widgets.image_with_reflection.ImageWithReflection, elisa.plugins.poblesec.widgets.long_loading_image.LongLoadingImage, elisa.plugins.poblesec.widgets.menu_item.MenuItemWidget, elisa.plugins.poblesec.widgets.nothing_to_display.NothingToDisplay, elisa.plugins.poblesec.widgets.search_results.SearchResultEntryWidget, elisa.plugins.poblesec.widgets.search_results.SearchResultWidget, elisa.plugins.poblesec.widgets.selector.ActionSelector, elisa.plugins.poblesec.widgets.sliced_image.SlicedImageHorizontal, elisa.plugins.shelf.shelf_controller.PluginWidget, elisa.plugins.shelf.shelf_controller.ShelfHeader, elisa.plugins.weather.report_widget.WeatherWidget
Set the default styles for the widget. Subclasses should override and call "self._update_style_properties()" after calling this base class constructor.

def state__get(self):
The present state of the widget

def state__set(self, state):
Set the state of the widget and emit the "state-changed" signal if necessary.

Parameters | state | the new state (type: enum(STATE_NORMAL, STATE_ACTIVE, STATE_PRELIGHT, STATE_SELECTED, STATE_INSENSITIVE) )

def do_state_changed(self, previous_state):
Default 'state-changed' handler

def style__get(self):
The present style

def style__set(self, style):
Set the present style, after binding it to the widget and subscribing for property change notifications.

Parameters | style | the style to set
| param | (type: `pgm.widget.Style` )

def do_style_set(self, style):
Default 'style-set' signal handler

def get_parent(self):
Get the parent, if exists.

Returns | `elisa.plugins.pigment.widgets.Widget`

def get_children(self):
Get the list of direct children.

Returns | list of `elisa.plugins.pigment.widgets.Widget`

def get_root(self):
Get the root of the widget's tree hierarchy

Returns | `elisa.plugins.pigment.widgets.Widget`

def get_descendants(self):
Get the list of nodes in the subtree

Returns | list of `elisa.plugins.pigment.widgets.Widget`

def focus__get(self):
Whether the widget has focus

def focus__set(self, value):

Set or unset the focus on the widget and emit the 'focus' signal.

If setting the focus on the current widget, walk throught the widget hierarchy it belongs to and unset the previously focused one.

Parameters | value | the focus value. (type: boolean. )

def focus_child__get(self):
Get the child with focus

def do_key_press_event(self, viewport, event, widget):
overridden in elisa.plugins.pigment.widgets.button.Button, elisa.plugins.pigment.widgets.entry.Entry, elisa.plugins.pigment.widgets.list_carrousel.ListCarrousel, elisa.plugins.pigment.widgets.list_horizontal.ListHorizontal, elisa.plugins.pigment.widgets.list_vertical.ListVertical, elisa.plugins.pigment.widgets.osk.OnScreenKeyboard, elisa.plugins.pigment.widgets.range.Range, elisa.plugins.poblesec.base.coverflow.CoverflowList

Default 'key-press-event' signal handler.

Forward the signal to the focused child, if any.

@classmethod
def demo(cls, plugin='opengl'):

Create a demo widget, put it on a canvas and show it in a viewport.

Just start a pgm.main() or an "ipython -gthread" shell to interactively test your widget. See the __main__ block at the end of this file.

Returns | the demo `elisa.plugins.pigment.widgets.Widget`