LevelBar
Superclasses: Widget
, InitiallyUnowned
, Object
Implemented Interfaces: Accessible
, AccessibleRange
, Buildable
, ConstraintTarget
, Orientable
- Constructors:
LevelBar(**properties)
new() -> Gtk.Widget
new_for_interval(min_value:float, max_value:float) -> Gtk.Widget
Constructors
Methods
- class LevelBar
- add_offset_value(name: str, value: float) None
Adds a new offset marker on
self
at the position specified byvalue
.When the bar value is in the interval topped by
value
(or betweenvalue
andmax_value
in case the offset is the last one on the bar) a style class namedlevel-```name`
will be applied when rendering the level bar fill.If another offset marker named
name
exists, its value will be replaced byvalue
.- Parameters:
name – the name of the new offset
value – the value for the new offset
- get_mode() LevelBarMode
Returns the
mode
of theGtkLevelBar
.
- get_offset_value(name: str | None = None) tuple[bool, float]
Fetches the value specified for the offset marker
name
inself
.- Parameters:
name – the name of an offset in the bar
- remove_offset_value(name: str | None = None) None
Removes an offset marker from a
GtkLevelBar
.The marker must have been previously added with
add_offset_value
.- Parameters:
name – the name of an offset in the bar
- set_inverted(inverted: bool) None
Sets whether the
GtkLevelBar
is inverted.- Parameters:
inverted –
True
to invert the level bar
- set_max_value(value: float) None
Sets the
max-value
of theGtkLevelBar
.You probably want to update preexisting level offsets after calling this function.
- Parameters:
value – a positive value
- set_min_value(value: float) None
Sets the
min-value
of theGtkLevelBar
.You probably want to update preexisting level offsets after calling this function.
- Parameters:
value – a positive value
- set_mode(mode: LevelBarMode) None
Sets the
mode
of theGtkLevelBar
.- Parameters:
mode – a
GtkLevelBarMode
Properties
- class LevelBar
- props.inverted: bool
Whether the
GtkLeveBar
is inverted.Level bars normally grow from top to bottom or left to right. Inverted level bars grow in the opposite direction.
- props.max_value: float
Determines the maximum value of the interval that can be displayed by the bar.
- props.min_value: float
Determines the minimum value of the interval that can be displayed by the bar.
- props.mode: LevelBarMode
Determines the way
GtkLevelBar
interprets the value properties to draw the level fill area.Specifically, when the value is
CONTINUOUS
,GtkLevelBar
will draw a single block representing the current value in that area; when the value isDISCRETE
, the widget will draw a succession of separate blocks filling the draw area, with the number of blocks being equal to the units separating the integral roundings ofmin_value
andmax_value
.
Signals
- class LevelBar.signals
- offset_changed(name: str) None
Emitted when an offset specified on the bar changes value.
This typically is the result of a
add_offset_value
call.The signal supports detailed connections; you can connect to the detailed signal “changed::x” in order to only receive callbacks when the value of offset “x” changes.
- Parameters:
name – the name of the offset that changed value