Class ScaleButton

All Implemented Interfaces:
PointerInterface
Direct Known Subclasses:
VolumeButton

public class ScaleButton extends Widget
`GtkScaleButton` 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 [class@Gtk.VolumeButton] subclass that
is tailored for this use case.

# CSS nodes

`GtkScaleButton` has a single CSS node with name button. To differentiate
it from a plain `GtkButton`, it gets the .scale style class.

https://docs.gtk.org/gtk4/class.ScaleButton.html

  • Field Details

  • Constructor Details

    • ScaleButton

      public ScaleButton(PointerContainer pointer)
    • ScaleButton

      public ScaleButton(double min, double max, double step, @Nullable Strs icons)
      Creates a `GtkScaleButton`.

      The new scale button has a range between @min and @max,
      with a stepping of @step.
      Parameters:
      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 %NULL-terminated array of icon names, or %NULL if you want to set the list later with gtk_scale_button_set_icons()
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getAdjustment

      public Adjustment getAdjustment()
      Gets the `GtkAdjustment` associated with the `GtkScaleButton`’s scale.

      See [method@Gtk.Range.get_adjustment] for details.
      Returns:
      the adjustment associated with the scale
    • getMinusButton

      public Button getMinusButton()
      Retrieves the minus button of the `GtkScaleButton`.
      Returns:
      the minus button of the `GtkScaleButton`
    • getPlusButton

      public Button getPlusButton()
      Retrieves the plus button of the `GtkScaleButton.`
      Returns:
      the plus button of the `GtkScaleButton`
    • getPopup

      public Widget getPopup()
      Retrieves the popup of the `GtkScaleButton`.
      Returns:
      the popup of the `GtkScaleButton`
    • getValue

      public double getValue()
      Gets the current value of the scale button.
      Returns:
      current value of the scale button
    • setAdjustment

      public void setAdjustment(@Nonnull Adjustment adjustment)
      Sets the `GtkAdjustment` to be used as a model
      for the `GtkScaleButton`’s scale.

      See [method@Gtk.Range.set_adjustment] for details.
      Parameters:
      adjustment - a `GtkAdjustment`
    • setIcons

      public void setIcons(@Nonnull Strs icons)
      Sets the icons to be used by the scale button.
      Parameters:
      icons - a %NULL-terminated array of icon names
    • setValue

      public void setValue(double 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 [signal@Gtk.ScaleButton::value-changed]
      signal if the value changes.
      Parameters:
      value - new value of the scale button
    • onPopdown

      public SignalHandler onPopdown(ScaleButton.OnPopdown signal)
      Connect to signal "popdown".
      See ScaleButton.OnPopdown.onPopdown() for signal description.
      Field SIGNAL_ON_POPDOWN contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • onPopup

      public SignalHandler onPopup(ScaleButton.OnPopup signal)
      Connect to signal "popup".
      See ScaleButton.OnPopup.onPopup() for signal description.
      Field SIGNAL_ON_POPUP contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • onValueChanged

      public SignalHandler onValueChanged(ScaleButton.OnValueChanged signal)
      Connect to signal "value-changed".
      See ScaleButton.OnValueChanged.onValueChanged(double) for signal description.
      Field SIGNAL_ON_VALUE_CHANGED contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • asAccessible

      public Accessible asAccessible()
      Implements interface Accessible. Call this to get access to interface functions.
      Overrides:
      asAccessible in class Widget
      Returns:
      Accessible
    • asBuildable

      public Buildable asBuildable()
      Implements interface Buildable. Call this to get access to interface functions.
      Overrides:
      asBuildable in class Widget
      Returns:
      Buildable
    • asConstraintTarget

      public ConstraintTarget asConstraintTarget()
      Implements interface ConstraintTarget. Call this to get access to interface functions.
      Overrides:
      asConstraintTarget in class Widget
      Returns:
      ConstraintTarget
    • asOrientable

      public Orientable asOrientable()
      Implements interface Orientable. Call this to get access to interface functions.
      Returns:
      Orientable
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()