Gnome::Gtk4::ScaleButton
#------------------------------------------------------------------------------- #--[Class Description]---------------------------------------------------------- #-------------------------------------------------------------------------------
=begin rakudoc
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
=end rakudoc
#------------------------------------------------------------------------------- #--[Class Initialization]------------------------------------------------------- #-------------------------------------------------------------------------------
=begin rakudoc
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! )
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
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().
=end rakudoc
#------------------------------------------------------------------------------- #--[Methods]-------------------------------------------------------------------- #-------------------------------------------------------------------------------
=begin rakudoc
Methods =end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
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.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
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 )
Return value; the adjustment associated with the scale.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-has-frame
Returns whether the button has a frame.
method get-has-frame (--> Bool )
Return value; True if the button has a frame.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
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.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
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.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-popup
Retrieves the popup of the Gnome::Gtk4::ScaleButton.
method get-popup (--> N-Object )
Return value; the popup of the Gnome::Gtk4::ScaleButton.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-value
Gets the current value of the scale button.
method get-value (--> Num )
Return value; current value of the scale button.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
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 )
$adjustment; a Gnome::Gtk4::Adjustment.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
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.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
set-icons
Sets the icons to be used by the scale button.
method set-icons ( Array[Str] $icons )
$icons; a icon array names.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
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.
=end rakudoc
#------------------------------------------------------------------------------- #--[Signal Documentation]------------------------------------------------------- #-------------------------------------------------------------------------------
=begin rakudoc
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
)
$_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.
popup
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
)
$_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
)
$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.
=end rakudoc