About all my projects
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.

Class initialization

new

:native-object

Create an object using a native object from elsewhere. See also Gnome::N::TopLevelSupportClass.

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

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 \)
  • $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 )

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 Gnome::Gtk4::Range for details.

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

Return value; the adjustment associated with the scale.

get-has-frame

Returns whether the button has a frame.

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

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 )

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 )

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 )

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

get-value

Gets the current value of the scale button.

method get-value (--> Num )

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 Gnome::Gtk4::Range for details.

method set-adjustment ( N-Object() $adjustment )
  • $adjustment; a Gnome::Gtk4::Adjustment.

set-has-frame

Sets the style of the button.

method set-has-frame ( Bool() $has-frame )
  • $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 )
  • $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 )
  • $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,
  *C<user>-options
)
  • $_handle_id; The registered event handler id.

  • $_native-object; The native object provided by the Raku object which registered this event. This a native Gnome::Gtk4::ScaleButton object.

  • $_widget; The object which registered the signal. User code may have left the object going out of scope.

  • user-options; A list of named arguments provided at the .register-signal() method from Gnome::GObject::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,
  *C<user>-options
)
  • $_handle_id; The registered event handler id.

  • $_native-object; The native object provided by the Raku object which registered this event. This a native Gnome::Gtk4::ScaleButton object.

  • $_widget; The object which registered the signal. User code may have left the object going out of scope.

  • user-options; A list of named arguments provided at the .register-signal() method from Gnome::GObject::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,
  *C<user>-options
)
  • $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 a native Gnome::Gtk4::ScaleButton object.

  • $_widget; The object which registered the signal. User code may have left the object going out of scope.

  • user-options; A list of named arguments provided at the .register-signal() method from Gnome::GObject::Object.