About my projects, examples and tutorials
Gnome::Gtk4::ScaleButton

Gnome::Gtk4::ScaleButton

Description§

Gnome::Gtk4::ScaleButton provides a button which pops up a scale widget.

This kind of widget is commonly used for volume controls in multimedia applications, and GTK provides a Gnome::Gtk4::VolumeButton subclass that is tailored for this use case.

CSS nodes§

Gnome::Gtk4::ScaleButton has a single CSS node with name scalebutton and `.scale` style class, and contains a button node with a `.toggle` style class.

Uml Diagram§

UNKNOWN image§

=for image :class<inline> :src<asset_files/images/plantuml/ScaleButton.png> :width<70\%>

Class initialization§

new§

:native-object§

Create an object using a native object from an object of the same type found elsewhere. See also Gnome::N::TopLevelSupportClass.

multi method new ( N-Object() :$native-object! )
Code

new-scalebutton§

Creates a Gnome::Gtk4::ScaleButton.

The new scale button has a range between $min and $max, with a stepping of $step.

method new-scalebutton ( Num() $min, Num() $max, Num() $step, Array[Str] $icons --> Gnome::Gtk4::ScaleButton )
Code
  • $min; the minimum value of the scale (usually 0).
  • $max; the maximum value of the scale (usually 100).
  • $step; the stepping of value when a scroll-wheel event, or up/down arrow event occurs (usually 2).
  • $icons; a icon array names, or undefined if you want to set the list later with .set-icons().

Methods§

get-active§

Queries a Gnome::Gtk4::ScaleButton and returns its current state.

Returns True if the scale button is pressed in and False if it is raised.

method get-active (--> Bool )
Code

Return value; whether the button is pressed.

get-adjustment§

Gets the Gnome::Gtk4::Adjustment associated with the Gnome::Gtk4::ScaleButton’s scale.

See .get-adjustment() in class Range for details.

method get-adjustment (--> N-Object )
Code

Return value; the adjustment associated with the scale.

get-has-frame§

Returns whether the button has a frame.

method get-has-frame (--> Bool )
Code

Return value; True if the button has a frame.

get-minus-button§

Retrieves the minus button of the Gnome::Gtk4::ScaleButton.

method get-minus-button (--> N-Object )
Code

Return value; the minus button of the Gnome::Gtk4::ScaleButton.

get-plus-button§

Retrieves the plus button of the Gnome::Gtk4::ScaleButton.`

method get-plus-button (--> N-Object )
Code

Return value; the plus button of the Gnome::Gtk4::ScaleButton.

get-popup§

Retrieves the popup of the Gnome::Gtk4::ScaleButton.

method get-popup (--> N-Object )
Code

Return value; the popup of the Gnome::Gtk4::ScaleButton.

get-value§

Gets the current value of the scale button.

method get-value (--> Num )
Code

Return value; current value of the scale button.

set-adjustment§

Sets the Gnome::Gtk4::Adjustment to be used as a model for the Gnome::Gtk4::ScaleButton’s scale.

See .set-adjustment() in class Range for details.

method set-adjustment ( N-Object() $adjustment )
Code

set-has-frame§

Sets the style of the button.

method set-has-frame ( Bool() $has-frame )
Code
  • $has-frame; whether the button should have a visible frame.

set-icons§

Sets the icons to be used by the scale button.

method set-icons ( Array[Str] $icons )
Code
  • $icons; a icon array names.

set-value§

Sets the current value of the scale.

If the value is outside the minimum or maximum range values, it will be clamped to fit inside them.

The scale button emits the value-changed signal if the value changes.

method set-value ( Num() $value )
Code
  • $value; new value of the scale button.

Signals§

popdown§

Emitted to dismiss the popup.

This is a [keybinding signal](class.SignalAction.html).

The default binding for this signal is <kbd>Escape</kbd>.

method handler (
  Int :$_handle_id,
  N-GObject :$_native-object,
  Gnome::Gtk4::ScaleButton :$_widget,
  *%user-options
)
Code
  • $_handle_id; The registered event handler id.
  • $_native-object; The native object provided by the Raku object which registered this event. This is a native Gnome::Gtk4::ScaleButton object.
  • %user-options; A list of named arguments provided by .register-signal() in class Object.

Emitted to popup the scale widget.

This is a [keybinding signal](class.SignalAction.html).

The default bindings for this signal are <kbd>Space</kbd>, <kbd>Enter</kbd> and <kbd>Return</kbd>.

method handler (
  Int :$_handle_id,
  N-GObject :$_native-object,
  Gnome::Gtk4::ScaleButton :$_widget,
  *%user-options
)
Code
  • $_handle_id; The registered event handler id.
  • $_native-object; The native object provided by the Raku object which registered this event. This is a native Gnome::Gtk4::ScaleButton object.
  • %user-options; A list of named arguments provided by .register-signal() in class Object.

value-changed§

Emitted when the value field has changed.

method handler (
  gdouble $value,
  Int :$_handle_id,
  N-GObject :$_native-object,
  Gnome::Gtk4::ScaleButton :$_widget,
  *%user-options
)
Code
  • $value; the new value.
  • $_handle_id; The registered event handler id.
  • $_native-object; The native object provided by the Raku object which registered this event. This is a native Gnome::Gtk4::ScaleButton object.
  • %user-options; A list of named arguments provided by .register-signal() in class Object.