Package ch.bailu.gtk.gtk
Class Range
- All Implemented Interfaces:
PointerInterface
- Direct Known Subclasses:
Scale
`GtkRange` is the common base class for widgets which visualize an
adjustment.
Widgets that are derived from `GtkRange` include
[class@Gtk.Scale] and [class@Gtk.Scrollbar].
Apart from signals for monitoring the parameters of the adjustment,
`GtkRange` provides properties and methods for setting a
“fill level” on range widgets. See [method@Gtk.Range.set_fill_level].
adjustment.
Widgets that are derived from `GtkRange` include
[class@Gtk.Scale] and [class@Gtk.Scrollbar].
Apart from signals for monitoring the parameters of the adjustment,
`GtkRange` provides properties and methods for setting a
“fill level” on range widgets. See [method@Gtk.Range.set_fill_level].
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
static interface
static interface
Nested classes/interfaces inherited from class ch.bailu.gtk.gtk.Widget
Widget.OnDestroy, Widget.OnDestroyNotify, Widget.OnDirectionChanged, Widget.OnHide, Widget.OnKeynavFailed, Widget.OnMap, Widget.OnMnemonicActivate, Widget.OnMoveFocus, Widget.OnQueryTooltip, Widget.OnRealize, Widget.OnShow, Widget.OnStateFlagsChanged, Widget.OnTickCallback, Widget.OnUnmap, Widget.OnUnrealize
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
Fields inherited from class ch.bailu.gtk.gtk.Widget
SIGNAL_ON_DESTROY, SIGNAL_ON_DIRECTION_CHANGED, SIGNAL_ON_HIDE, SIGNAL_ON_KEYNAV_FAILED, SIGNAL_ON_MAP, SIGNAL_ON_MNEMONIC_ACTIVATE, SIGNAL_ON_MOVE_FOCUS, SIGNAL_ON_QUERY_TOOLTIP, SIGNAL_ON_REALIZE, SIGNAL_ON_SHOW, SIGNAL_ON_STATE_FLAGS_CHANGED, SIGNAL_ON_UNMAP, SIGNAL_ON_UNREALIZE
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionImplements interfaceAccessible
.Implements interfaceBuildable
.Implements interfaceConstraintTarget
.Implements interfaceOrientable
.Get the adjustment which is the “model” object for `GtkRange`.static ClassHandler
double
Gets the current position of the fill level indicator.boolean
Gets whether the `GtkRange` respects text direction.static int
boolean
Gets whether the range is inverted.static long
static TypeSystem.TypeSize
void
getRangeRect
(Rectangle range_rect) This function returns the area that contains the range’s trough,
in coordinates relative to @range's origin.boolean
Gets whether the range is restricted to the fill level.int
Gets the number of digits to round the value to when
it changes.boolean
Gets whether the range displays the fill level graphically.void
getSliderRange
(Int slider_start, Int slider_end) This function returns sliders range along the long dimension,
in widget->window coordinates.boolean
This function is useful mainly for `GtkRange` subclasses.static long
static TypeSystem.TypeSize
double
getValue()
Gets the current value of the range.onAdjustBounds
(Range.OnAdjustBounds signal) Connect to signal "adjust-bounds".onChangeValue
(Range.OnChangeValue signal) Connect to signal "change-value".onMoveSlider
(Range.OnMoveSlider signal) Connect to signal "move-slider".onValueChanged
(Range.OnValueChanged signal) Connect to signal "value-changed".void
setAdjustment
(Adjustment adjustment) Sets the adjustment to be used as the “model” object for the `GtkRange`
The adjustment indicates the current range value, the minimum and
maximum range values, the step/page increments used for keybindings
and scrolling, and the page size.void
setFillLevel
(double fill_level) Set the new position of the fill level indicator.void
setFlippable
(boolean flippable) Sets whether the `GtkRange` respects text direction.void
setIncrements
(double step, double page) Sets the step and page sizes for the range.void
setInverted
(boolean setting) Sets whether to invert the range.void
setRange
(double min, double max) Sets the allowable values in the `GtkRange`.void
setRestrictToFillLevel
(boolean restrict_to_fill_level) Sets whether the slider is restricted to the fill level.void
setRoundDigits
(int round_digits) Sets the number of digits to round the value to when
it changes.void
setShowFillLevel
(boolean show_fill_level) Sets whether a graphical fill level is show on the trough.void
setSliderSizeFixed
(boolean size_fixed) Sets whether the range’s slider has a fixed size, or a size that
depends on its adjustment’s page size.void
setValue
(double value) Sets the current value of the range.Methods inherited from class ch.bailu.gtk.gtk.Widget
actionSetEnabled, actionSetEnabled, activate, activateAction, activateAction, activateActionVariant, activateActionVariant, activateDefault, addController, addCssClass, addCssClass, addMnemonicLabel, addTickCallback, allocate, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getCanFocus, getCanTarget, getChildVisible, getClipboard, 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, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth, grabFocus, hasCssClass, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, observeChildren, observeControllers, onDestroy, onDirectionChanged, onHide, onKeynavFailed, onMap, onMnemonicActivate, onMoveFocus, onQueryTooltip, onRealize, onShow, onStateFlagsChanged, onUnmap, onUnrealize, pick, queueAllocate, queueDraw, queueResize, realize, removeController, removeCssClass, removeCssClass, removeMnemonicLabel, removeTickCallback, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setCursorFromName, setDefaultDirection, setDirection, setFocusable, setFocusChild, setFocusOnClick, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setName, setOpacity, setOverflow, setParent, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipMarkup, setTooltipText, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, shouldLayout, show, sizeAllocate, snapshotChild, triggerTooltipQuery, unmap, unparent, unrealize, unsetStateFlags
Methods inherited from class ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Field Details
-
SIGNAL_ON_ADJUST_BOUNDS
- See Also:
-
SIGNAL_ON_CHANGE_VALUE
- See Also:
-
SIGNAL_ON_MOVE_SLIDER
- See Also:
-
SIGNAL_ON_VALUE_CHANGED
- See Also:
-
-
Constructor Details
-
Range
-
-
Method Details
-
getClassHandler
-
getAdjustment
Get the adjustment which is the “model” object for `GtkRange`.- Returns:
- a `GtkAdjustment`
-
getFillLevel
public double getFillLevel()Gets the current position of the fill level indicator.- Returns:
- The current fill level
-
getFlippable
public boolean getFlippable()Gets whether the `GtkRange` respects text direction.
See [method@Gtk.Range.set_flippable].- Returns:
- %TRUE if the range is flippable
-
getInverted
public boolean getInverted()Gets whether the range is inverted.
See [method@Gtk.Range.set_inverted].- Returns:
- %TRUE if the range is inverted
-
getRangeRect
This function returns the area that contains the range’s trough,
in coordinates relative to @range's origin.
This function is useful mainly for `GtkRange` subclasses.- Parameters:
range_rect
- return location for the range rectangle
-
getRestrictToFillLevel
public boolean getRestrictToFillLevel()Gets whether the range is restricted to the fill level.- Returns:
- %TRUE if @range is restricted to the fill level.
-
getRoundDigits
public int getRoundDigits()Gets the number of digits to round the value to when
it changes.
See [signal@Gtk.Range::change-value].- Returns:
- the number of digits to round to
-
getShowFillLevel
public boolean getShowFillLevel()Gets whether the range displays the fill level graphically.- Returns:
- %TRUE if @range shows the fill level.
-
getSliderRange
This function returns sliders range along the long dimension,
in widget->window coordinates.
This function is useful mainly for `GtkRange` subclasses.- Parameters:
slider_start
- return location for the slider's startslider_end
- return location for the slider's end
-
getSliderSizeFixed
public boolean getSliderSizeFixed()This function is useful mainly for `GtkRange` subclasses.
See [method@Gtk.Range.set_slider_size_fixed].- Returns:
- whether the range’s slider has a fixed size.
-
getValue
public double getValue()Gets the current value of the range.- Returns:
- current value of the range.
-
setAdjustment
Sets the adjustment to be used as the “model” object for the `GtkRange`
The adjustment indicates the current range value, the minimum and
maximum range values, the step/page increments used for keybindings
and scrolling, and the page size.
The page size is normally 0 for `GtkScale` and nonzero for `GtkScrollbar`,
and indicates the size of the visible area of the widget being scrolled.
The page size affects the size of the scrollbar slider.- Parameters:
adjustment
- a `GtkAdjustment`
-
setFillLevel
public void setFillLevel(double fill_level) Set the new position of the fill level indicator.
The “fill level” is probably best described by its most prominent
use case, which is an indicator for the amount of pre-buffering in
a streaming media player. In that use case, the value of the range
would indicate the current play position, and the fill level would
be the position up to which the file/stream has been downloaded.
This amount of prebuffering can be displayed on the range’s trough
and is themeable separately from the trough. To enable fill level
display, use [method@Gtk.Range.set_show_fill_level]. The range defaults
to not showing the fill level.
Additionally, it’s possible to restrict the range’s slider position
to values which are smaller than the fill level. This is controlled
by [method@Gtk.Range.set_restrict_to_fill_level] and is by default
enabled.- Parameters:
fill_level
- the new position of the fill level indicator
-
setFlippable
public void setFlippable(boolean flippable) Sets whether the `GtkRange` respects text direction.
If a range is flippable, it will switch its direction
if it is horizontal and its direction is %GTK_TEXT_DIR_RTL.
See [method@Gtk.Widget.get_direction].- Parameters:
flippable
- %TRUE to make the range flippable
-
setIncrements
public void setIncrements(double step, double page) Sets the step and page sizes for the range.
The step size is used when the user clicks the `GtkScrollbar`
arrows or moves a `GtkScale` via arrow keys. The page size
is used for example when moving via Page Up or Page Down keys.- Parameters:
step
- step sizepage
- page size
-
setInverted
public void setInverted(boolean setting) Sets whether to invert the range.
Ranges normally move from lower to higher values as the
slider moves from top to bottom or left to right. Inverted
ranges have higher values at the top or on the right rather
than on the bottom or left.- Parameters:
setting
- %TRUE to invert the range
-
setRange
public void setRange(double min, double max) Sets the allowable values in the `GtkRange`.
The range value is clamped to be between @min and @max.
(If the range has a non-zero page size, it is clamped
between @min and @max - page-size.)- Parameters:
min
- minimum range valuemax
- maximum range value
-
setRestrictToFillLevel
public void setRestrictToFillLevel(boolean restrict_to_fill_level) Sets whether the slider is restricted to the fill level.
See [method@Gtk.Range.set_fill_level] for a general description
of the fill level concept.- Parameters:
restrict_to_fill_level
- Whether the fill level restricts slider movement.
-
setRoundDigits
public void setRoundDigits(int round_digits) Sets the number of digits to round the value to when
it changes.
See [signal@Gtk.Range::change-value].- Parameters:
round_digits
- the precision in digits, or -1
-
setShowFillLevel
public void setShowFillLevel(boolean show_fill_level) Sets whether a graphical fill level is show on the trough.
See [method@Gtk.Range.set_fill_level] for a general description
of the fill level concept.- Parameters:
show_fill_level
- Whether a fill level indicator graphics is shown.
-
setSliderSizeFixed
public void setSliderSizeFixed(boolean size_fixed) Sets whether the range’s slider has a fixed size, or a size that
depends on its adjustment’s page size.
This function is useful mainly for `GtkRange` subclasses.- Parameters:
size_fixed
- %TRUE to make the slider size constant
-
setValue
public void setValue(double value) Sets the current value of the range.
If the value is outside the minimum or maximum range values,
it will be clamped to fit inside them. The range emits the
[signal@Gtk.Range::value-changed] signal if the value changes.- Parameters:
value
- new value of the range
-
onAdjustBounds
Connect to signal "adjust-bounds".
SeeRange.OnAdjustBounds.onAdjustBounds(double)
for signal description.
FieldSIGNAL_ON_ADJUST_BOUNDS
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.
-
onChangeValue
Connect to signal "change-value".
SeeRange.OnChangeValue.onChangeValue(int, double)
for signal description.
FieldSIGNAL_ON_CHANGE_VALUE
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.
-
onMoveSlider
Connect to signal "move-slider".
SeeRange.OnMoveSlider.onMoveSlider(int)
for signal description.
FieldSIGNAL_ON_MOVE_SLIDER
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
Connect to signal "value-changed".
SeeRange.OnValueChanged.onValueChanged()
for signal description.
FieldSIGNAL_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
Implements interfaceAccessible
. Call this to get access to interface functions.- Overrides:
asAccessible
in classWidget
- Returns:
Accessible
-
asBuildable
Implements interfaceBuildable
. Call this to get access to interface functions.- Overrides:
asBuildable
in classWidget
- Returns:
Buildable
-
asConstraintTarget
Implements interfaceConstraintTarget
. Call this to get access to interface functions.- Overrides:
asConstraintTarget
in classWidget
- Returns:
ConstraintTarget
-
asOrientable
Implements interfaceOrientable
. Call this to get access to interface functions.- Returns:
Orientable
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-