Widgets (moire.widgets)¶
The package with the widgets and UI components.
You may use widgets
package as a shortcut to the following
classes.
widgets.PanelWidget
→moire.widgets.panel.PanelWidget
widgets.SystemInfoWidget
→moire.widgets.sysinfo.SystemInfoWidget
widgets.DescriptiveList
→moire.widgets.dlist.DescriptiveList
Descriptive List (moire.widgets.dlist)¶
The module with a two-column param-value list.
-
class
moire.widgets.dlist.
DescriptiveList
(fields, item_width, item_height=25, **kwargs)¶ Bases:
object
The widget representing key-value descriptive list.
Initially, values are empty, but could be changed at runtime like:
my_list = DescriptiveList(['Foo', 'Bar'], 200, 200) # ...sometimes later my_list['Foo'] = '235'
Parameters: - fields – A list of field names, to be shown at the left column in bold font. This will also be keys for values access.
- item_width – The width of the item in inner units.
- item_height – The height of the item in inner units.
Panel Base (moire.widgets.panel)¶
Module with the base Panel
class.
-
class
moire.widgets.panel.
PanelWidget
(**kwargs)¶ Bases:
object
The implementation of the base panel widget.
Other widgets could be inherited from
Panel
in order to get the standard visual decoration and show/hide transitions.-
redraw
(*_args)¶ Redraw panel on the canvas.
-
toggle
()¶ Toggle show/hide the panel with its contents.
-
System Info (moire.widgets.sysinfo)¶
Module for widget with system info.
-
class
moire.widgets.sysinfo.
NumericProperty
¶ Bases:
object
-
class
moire.widgets.sysinfo.
SystemInfoWidget
(**kwargs)¶ Bases:
moire.widgets.panel.PanelWidget
Build-in widget showing system info.
The fields are:
- FPS
- Current frames per second speed (for GUI).
- SPS
- Current steps per second speed (for simulation).
- Speed
- How many steps are skipped each frame.
- Time
- Global timestep counter.
-
fps
= <NumericProperty object>¶ Desired frame rate