Class ScaleButton.Builder<B extends ScaleButton.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
Accessible.Builder<B>, Orientable.Builder<B>, BuilderInterface
Direct Known Subclasses:
VolumeButton.Builder
Enclosing class:
ScaleButton

public static class ScaleButton.Builder<B extends ScaleButton.Builder<B>> extends Widget.Builder<B> implements Accessible.Builder<B>, Orientable.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public ScaleButton build()
      Finish building the ScaleButton object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to ScaleButton.
      Overrides:
      build in class Widget.Builder<B extends ScaleButton.Builder<B>>
      Returns:
      a new instance of ScaleButton with the properties that were set in the Builder object.
    • setAdjustment

      public B setAdjustment(Adjustment adjustment)
      The GtkAdjustment that is used as the model.
      Parameters:
      adjustment - the value for the adjustment property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setHasFrame

      public B setHasFrame(boolean hasFrame)
      If the scale button has a frame.
      Parameters:
      hasFrame - the value for the has-frame property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.14
    • setIcons

      public B setIcons(String[] icons)

      The names of the icons to be used by the scale button.

      The first item in the array will be used in the button when the current value is the lowest value, the second item for the highest value. All the subsequent icons will be used for all the other values, spread evenly over the range of values.

      If there's only one icon name in the icons array, it will be used for all the values. If only two icon names are in the icons array, the first one will be used for the bottom 50% of the scale, and the second one for the top 50%.

      It is recommended to use at least 3 icons so that the GtkScaleButton reflects the current value of the scale better for the users.

      Parameters:
      icons - the value for the icons property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setValue

      public B setValue(double value)
      The value of the scale.
      Parameters:
      value - the value for the value property
      Returns:
      the Builder instance is returned, to allow method chaining
    • onPopdown

      public B onPopdown(ScaleButton.PopdownCallback handler)

      Emitted to dismiss the popup.

      This is a keybinding signal.

      The default binding for this signal is Escape.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onPopup

      public B onPopup(ScaleButton.PopupCallback handler)

      Emitted to popup the scale widget.

      This is a keybinding signal.

      The default bindings for this signal are Space, Enter and Return.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onValueChanged

      public B onValueChanged(ScaleButton.ValueChangedCallback handler)
      Emitted when the value field has changed.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also: