[544:14] static extends: object
Generated metadata helpers for LevelBar class surfaces.
properties ()
Returns property metadata for
LevelBar.
A list.signals ()
Returns signal metadata for
LevelBar.
A list.[57:7] extends: object
Shows a level indicator. Typical use cases are displaying the strength of a
password, or showing the charge level of a battery.
c static GtkWidget * create_level_bar (void) { GtkWidget *widget; GtkLevelBar *bar; widget = gtk_level_bar_new (); bar = GTK_LEVEL_BAR (widget); // This changes the value of the default low offset gtk_level_bar_add_offset_value (bar, GTK_LEVEL_BAR_OFFSET_LOW, 0.10); // This adds a new offset to the bar; the application will // be able to change its color CSS like this: // // levelbar block.my-offset { // background-color: magenta; // border-style: solid; // border-color: black; // border-width: 1px; // } gtk_level_bar_add_offset_value (bar, "my-offset", 0.60); return widget; }
The default interval of values is between zero and one, but it’s possible to
modify the interval using [method@Gtk.LevelBar.set_min_value] and
[method@Gtk.LevelBar.set_max_value]. The value will be always drawn in
proportion to the admissible interval, i.e. a value of 15 with a specified
interval between 10 and 20 is equivalent to a value of 0.5 with an interval
between 0 and 1. When %GTK_LEVEL_BAR_MODE_DISCRETE is used, the bar level is
rendered as a finite number of separated blocks instead of a single one. The
number of blocks that will be rendered is equal to the number of units
specified by the admissible interval. For instance, to build a bar rendered
with five blocks, it’s sufficient to set the minimum value to 0 and the
maximum value to 5 after changing the indicator mode to discrete. #
GtkLevelBar as GtkBuildable The GtkLevelBar implementation of the
GtkBuildable interface supports a custom <offsets> element, which can
contain any number of <offset> elements, each of which must have "name" and
"value" attributes. # CSS nodes levelbar[.discrete] ╰── trough ├── block.filled.level-name ┊ ├── block.empty ┊ GtkLevelBar has a main CSS
node with name levelbar and one of the style classes .discrete or .continuous
and a subnode with name trough. Below the trough node are a number of nodes
with name block and style class .filled or .empty. In continuous mode, there
is exactly one node of each, in discrete mode, the number of filled and
unfilled nodes corresponds to blocks that are drawn. The block.filled nodes
also get a style class .level-name corresponding to the level for the current
value. In horizontal orientation, the nodes are always arranged from left to
right, regardless of text direction. # Accessibility GtkLevelBar uses the
[enum@Gtk.AccessibleRole.meter] role.
LevelBar ()
Creates a new
GtkLevelBar.
toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asWidget ()
Wraps this handle as
Widget.
A Widget object.asAccessible ()
Wraps this handle as
Accessible.
A Accessible object.asAccessibleRange ()
Wraps this handle as
AccessibleRange.
A AccessibleRange object.asBuildable ()
Wraps this handle as
Buildable.
A Buildable object.asConstraintTarget ()
Wraps this handle as
ConstraintTarget.
A ConstraintTarget object.asOrientable ()
Wraps this handle as
Orientable.
A Orientable object.connectSignal (string Name, CallbackObj)
Connects one generated callback wrapper to a named signal.
Name is the signal name.CallbackObj is the generated callback wrapper to connect.The connected handler id.disconnectSignalHandler (int HandlerId)
Disconnects one retained signal handler id.
HandlerId is the signal handler id to disconnect.None.setOnOffsetchanged (callback Fn, UserData = null)
Emitted when an offset specified on the bar changes value. This typically is the result of a [method@Gtk.LevelBar.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.
Fn is the Aussom callback.Fn is called with (LevelBar Self, string Name).UserData is retained and passed through to the generated callback wrapper when provided.The connected handler id.getProperty (string Name)
Reads one generated property by name.
setProperty (string Name, Value)
Writes one generated property by name.
setInverted (bool Value)
Whether the
GtkLeveBaris inverted. Level bars normally grow from top to bottom or left to right. Inverted level bars grow in the opposite direction.
Value is the new property value.None.setMaxvalue (double Value)
Determines the maximum value of the interval that can be displayed by the bar.
Value is the new property value.None.setMinvalue (double Value)
Determines the minimum value of the interval that can be displayed by the bar.
Value is the new property value.None.setMode (string Value)
Determines the way
GtkLevelBarinterprets the value properties to draw the level fill area. Specifically, when the value is %GTK_LEVEL_BAR_MODE_CONTINUOUS,GtkLevelBarwill draw a single block representing the current value in that area; when the value is %GTK_LEVEL_BAR_MODE_DISCRETE, 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 of [property@Gtk.LevelBar:min-value] and [property@Gtk.LevelBar:max-value].
Value is the new property value.None.setValue (double Value)
Determines the currently filled value of the level bar.
Value is the new property value.None.add_offset_value (string name, double value)
Adds a new offset marker on @self at the position specified by @value. When the bar value is in the interval topped by @value (or between @value and [property@Gtk.LevelBar:max-value] in case the offset is the last one on the bar) a style class named
level-@name will be applied when rendering the level bar fill. If another offset marker named @name exists, its value will be replaced by @value.
name is the name of the new offset.value is the value for the new offset.None.get_inverted ()
Returns whether the levelbar is inverted.
get_max_value ()
Returns the
max-valueof theGtkLevelBar.
get_min_value ()
Returns the
min-valueof theGtkLevelBar.
get_mode ()
Returns the
modeof theGtkLevelBar.
get_value ()
Returns the
valueof theGtkLevelBar.
remove_offset_value (string name)
Removes an offset marker from a
GtkLevelBar. The marker must have been previously added with [method@Gtk.LevelBar.add_offset_value].
name is the name of an offset in the bar.None.set_inverted (bool inverted)
Sets whether the
GtkLevelBaris inverted.
inverted is %TRUE to invert the level bar.None.set_max_value (double value)
Sets the
max-valueof theGtkLevelBar. You probably want to update preexisting level offsets after calling this function.
value is a positive value.None.set_min_value (double value)
Sets the
min-valueof theGtkLevelBar. You probably want to update preexisting level offsets after calling this function.
value is a positive value.None.set_mode (string mode)
Sets the
modeof theGtkLevelBar.
mode is a GtkLevelBarMode.None.set_value (double value)
Sets the value of the
GtkLevelBar.
value is a value in the interval between [property@Gtk.LevelBar:min-value] and [property@Gtk.LevelBar:max-value].None.[456:14] static extends: object
Alternate constructors for LevelBar. Usage:
LevelBarCtors.<name>(...). The primary constructor lives
directly on LevelBar.
newForInterval (double min_value, double max_value)
Creates a new
GtkLevelBarfor the specified interval.
min_value is a positive value.max_value is a positive value.A new LevelBar.[474:7] extends: object
Generated low-level callback wrapper for GIR callback offset-changed.
LevelBarOffsetchangedCallback (callback Fn, UserData = null)
Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking
Fn.
Fn is the Aussom callback implementation.UserData is retained and passed through to Fn on each invocation when provided.trampoline (nativeSelf, name, nativeUserData)
Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.
callback ()
Returns the wrapped NativeCallback.
handle ()
Returns the callback as a NativeHandle.
close ()
Closes the underlying NativeCallback.
isClosed ()
Returns true when the callback has been closed.