Class ScaleButton
- All Implemented Interfaces:
Proxy
,Accessible
,AccessibleRange
,Buildable
,ConstraintTarget
,Orientable
- Direct Known Subclasses:
VolumeButton
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 VolumeButton
subclass that
is tailored for this use case.
Shortcuts and Gestures
The following signals have default keybindings:
Gtk.ScaleButton::popup
CSS nodes
scalebutton.scale
╰── button.toggle
╰── <icon>
GtkScaleButton
has a single CSS node with name scalebutton and .scale
style class, and contains a button
node with a .toggle
style class.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
ScaleButton.Builder<B extends ScaleButton.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.static interface
Functional interface declaration of thePopdownCallback
callback.static interface
Functional interface declaration of thePopupCallback
callback.static class
static interface
Functional interface declaration of theValueChangedCallback
callback.Nested classes/interfaces inherited from class org.gnome.gtk.Widget
Widget.DestroyCallback, Widget.DirectionChangedCallback, Widget.HideCallback, Widget.KeynavFailedCallback, Widget.MapCallback, Widget.MnemonicActivateCallback, Widget.MoveFocusCallback, Widget.QueryTooltipCallback, Widget.RealizeCallback, Widget.ShowCallback, Widget.StateFlagsChangedCallback, Widget.UnmapCallback, Widget.UnrealizeCallback, Widget.WidgetClass, Widget.WidgetImpl
Nested classes/interfaces inherited from class org.gnome.gobject.InitiallyUnowned
InitiallyUnowned.InitiallyUnownedClass
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
Nested classes/interfaces inherited from interface org.gnome.gtk.Accessible
Accessible.AccessibleImpl, Accessible.AccessibleInterface
Nested classes/interfaces inherited from interface org.gnome.gtk.AccessibleRange
AccessibleRange.AccessibleRangeImpl, AccessibleRange.AccessibleRangeInterface
Nested classes/interfaces inherited from interface org.gnome.gtk.Buildable
Buildable.BuildableIface, Buildable.BuildableImpl
Nested classes/interfaces inherited from interface org.gnome.gtk.ConstraintTarget
ConstraintTarget.ConstraintTargetImpl, ConstraintTarget.ConstraintTargetInterface
Nested classes/interfaces inherited from interface org.gnome.gtk.Orientable
Orientable.OrientableIface, Orientable.OrientableImpl
-
Constructor Summary
ConstructorDescriptionScaleButton
(double min, double max, double step, @Nullable String[] icons) Creates aGtkScaleButton
.ScaleButton
(MemorySegment address) Create a ScaleButton proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected ScaleButton
asParent()
Returns this instance as if it were its parent type.static ScaleButton.Builder
<? extends ScaleButton.Builder> builder()
AScaleButton.Builder
object constructs aScaleButton
with the specified properties.void
Emits the "popdown" signal.void
Emits the "popup" signal.void
emitValueChanged
(double value) Emits the "value-changed" signal.boolean
Queries aGtkScaleButton
and returns its current state.Gets theGtkAdjustment
associated with theGtkScaleButton
’s scale.boolean
Returns whether the button has a frame.static MemoryLayout
The memory layout of the native struct.Retrieves the minus button of theGtkScaleButton
.Retrieves the plus button of theGtkScaleButton.
getPopup()
Retrieves the popup of theGtkScaleButton
.static Type
getType()
Get the GType of the ScaleButton classdouble
getValue()
Gets the current value of the scale button.onPopdown
(ScaleButton.PopdownCallback handler) Emitted to dismiss the popup.onPopup
(ScaleButton.PopupCallback handler) Emitted to popup the scale widget.Emitted when the value field has changed.void
setAdjustment
(Adjustment adjustment) Sets theGtkAdjustment
to be used as a model for theGtkScaleButton
’s scale.void
setHasFrame
(boolean hasFrame) Sets the style of the button.void
Sets the icons to be used by the scale button.void
setValue
(double value) Sets the current value of the scale.protected void
valueChanged
(double value) Methods inherited from class org.gnome.gtk.Widget
actionSetEnabled, activateActionIfExists, activateDefault, activateWidget, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, childFocus, computeBounds, computeExpand, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, cssChanged, directionChanged, disposeTemplate, dragCheckThreshold, emitDestroy, emitDirectionChanged, emitHide, emitKeynavFailed, emitMap, emitMnemonicActivate, emitMoveFocus, emitQueryTooltip, emitRealize, emitShow, emitStateFlagsChanged, emitUnmap, emitUnrealize, errorBell, focus, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getBaseline, getCanFocus, getCanTarget, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getDefaultDirection, getDirection, getDisplay, getFirstChild, getFocusable, getFocusChild, getFocusOnClick, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, moveFocus, observeChildren, observeControllers, onDestroy, onDirectionChanged, onHide, onKeynavFailed, onMap, onMnemonicActivate, onMoveFocus, onQueryTooltip, onRealize, onShow, onStateFlagsChanged, onUnmap, onUnrealize, pick, pick, queryTooltip, queueAllocate, queueDraw, queueResize, realize, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, root, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setDefaultDirection, setDirection, setFocusable, setFocusChild, setFocusOnClick, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, shouldLayout, show, sizeAllocate, sizeAllocate, snapshot, snapshotChild, stateFlagsChanged, systemSettingChanged, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unroot, unsetStateFlags, unsetStateFlags
Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newInstance, newInstance, newv, notify_, notify_, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.gnome.gtk.Accessible
announce, getAccessibleParent, getAccessibleRole, getAtContext, getBounds, getFirstAccessibleChild, getNextAccessibleSibling, getPlatformState, resetProperty, resetRelation, resetState, setAccessibleParent, updateNextAccessibleSibling, updateProperty, updateRelation, updateState
Methods inherited from interface org.gnome.gtk.Buildable
getBuildableId
Methods inherited from interface org.gnome.gtk.Orientable
getOrientation, setOrientation
-
Constructor Details
-
ScaleButton
Create a ScaleButton proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
ScaleButton
Creates aGtkScaleButton
.The new scale button has a range between
min
andmax
, with a stepping ofstep
.- 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
- anull
-terminated array of icon names, ornull
if you want to set the list later with gtk_scale_button_set_icons()
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()
doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName()
. This will call the native function pointer of this virtual method in the typeclass of the parent type. -
getActive
public boolean getActive()Queries aGtkScaleButton
and returns its current state.Returns
true
if the scale button is pressed in andfalse
if it is raised.- Returns:
- whether the button is pressed
-
getAdjustment
Gets theGtkAdjustment
associated with theGtkScaleButton
’s scale.See
Range.getAdjustment()
for details.- Returns:
- the adjustment associated with the scale
-
getHasFrame
public boolean getHasFrame()Returns whether the button has a frame.- Returns:
true
if the button has a frame
-
getMinusButton
Retrieves the minus button of theGtkScaleButton
.- Returns:
- the minus button
of the
GtkScaleButton
-
getPlusButton
Retrieves the plus button of theGtkScaleButton.
- Returns:
- the plus button
of the
GtkScaleButton
-
getPopup
Retrieves the popup of theGtkScaleButton
.- 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
Sets theGtkAdjustment
to be used as a model for theGtkScaleButton
’s scale.See
Range.setAdjustment(org.gnome.gtk.Adjustment)
for details.- Parameters:
adjustment
- aGtkAdjustment
-
setHasFrame
public void setHasFrame(boolean hasFrame) Sets the style of the button.- Parameters:
hasFrame
- whether the button should have a visible frame
-
setIcons
Sets the icons to be used by the scale button.- Parameters:
icons
- anull
-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
Gtk.ScaleButton::value-changed
signal if the value changes.- Parameters:
value
- new value of the scale button
-
valueChanged
protected void valueChanged(double value) -
onPopdown
Emitted to dismiss the popup.This is a keybinding signal.
The default binding for this signal is
Escape
.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitPopdown
public void emitPopdown()Emits the "popdown" signal. SeeonPopdown(org.gnome.gtk.ScaleButton.PopdownCallback)
. -
onPopup
Emitted to popup the scale widget.This is a keybinding signal.
The default bindings for this signal are
Space
,Enter
andReturn
.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitPopup
public void emitPopup()Emits the "popup" signal. SeeonPopup(org.gnome.gtk.ScaleButton.PopupCallback)
. -
onValueChanged
public SignalConnection<ScaleButton.ValueChangedCallback> onValueChanged(ScaleButton.ValueChangedCallback handler) Emitted when the value field has changed.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitValueChanged
public void emitValueChanged(double value) Emits the "value-changed" signal. SeeonValueChanged(org.gnome.gtk.ScaleButton.ValueChangedCallback)
. -
builder
AScaleButton.Builder
object constructs aScaleButton
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withScaleButton.Builder.build()
.
-