![]() |
![]() |
![]() |
GTK+ Reference Manual | ![]() |
---|---|---|---|---|
#include <gtk/gtk.h> GtkRange;gdouble gtk_range_get_fill_level (GtkRange *range);gboolean gtk_range_get_restrict_to_fill_level (GtkRange *range);gboolean gtk_range_get_show_fill_level (GtkRange *range);void gtk_range_set_fill_level (GtkRange *range,gdouble fill_level);void gtk_range_set_restrict_to_fill_level (GtkRange *range,gboolean restrict_to_fill_level);void gtk_range_set_show_fill_level (GtkRange *range,gboolean show_fill_level); GtkAdjustment* gtk_range_get_adjustment (GtkRange *range);void gtk_range_set_update_policy (GtkRange *range, GtkUpdateType policy);void gtk_range_set_adjustment (GtkRange *range, GtkAdjustment *adjustment);gboolean gtk_range_get_inverted (GtkRange *range);void gtk_range_set_inverted (GtkRange *range,gboolean setting); GtkUpdateType gtk_range_get_update_policy (GtkRange *range);gdouble gtk_range_get_value (GtkRange *range);void gtk_range_set_increments (GtkRange *range,gdouble step,gdouble page);void gtk_range_set_range (GtkRange *range,gdouble min,gdouble max);void gtk_range_set_value (GtkRange *range,gdouble value); enum GtkSensitivityType;void gtk_range_set_lower_stepper_sensitivity (GtkRange *range, GtkSensitivityType sensitivity); GtkSensitivityType gtk_range_get_lower_stepper_sensitivity (GtkRange *range);void gtk_range_set_upper_stepper_sensitivity (GtkRange *range, GtkSensitivityType sensitivity); GtkSensitivityType gtk_range_get_upper_stepper_sensitivity (GtkRange *range);
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkRange +----GtkScale +----GtkScrollbar
adjustment GtkAdjustment : Read / Write / Construct fill-levelgdouble : Read / Write invertedgboolean : Read / Write lower-stepper-sensitivity GtkSensitivityType : Read / Write restrict-to-fill-levelgboolean : Read / Write show-fill-levelgboolean : Read / Write update-policy GtkUpdateType : Read / Write upper-stepper-sensitivity GtkSensitivityType : Read / Write
activate-slidergboolean : Read arrow-displacement-xgint : Read arrow-displacement-ygint : Read slider-widthgint : Read stepper-sizegint : Read stepper-spacinggint : Read trough-bordergint : Read trough-side-detailsgboolean : Read trough-under-steppersgboolean : Read
adjust-bounds : Run Last change-value : Run Last move-slider : Run Last / Action value-changed : Run Last
gdouble gtk_range_get_fill_level (GtkRange *range);
Gets the current position of the fill level indicator.
range : |
A GtkRange |
Returns : | The current fill level |
Since 2.12
gboolean gtk_range_get_restrict_to_fill_level (GtkRange *range);
Gets whether the range is restricted to the fill level.
range : |
A GtkRange |
Returns : | TRUE range is restricted to the fill level.
|
Since 2.12
gboolean gtk_range_get_show_fill_level (GtkRange *range);
Gets whether the range displays the fill level graphically.
range : |
A GtkRange |
Returns : | TRUE range shows the fill level.
|
Since 2.12
void gtk_range_set_fill_level (GtkRange *range,gdouble 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 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 controller
by gtk_range_set_restrict_to_fill_level()
and is by default
enabled.
range : |
a GtkRange |
fill_level : |
the new position of the fill level indicator |
Since 2.12
void gtk_range_set_restrict_to_fill_level (GtkRange *range,gboolean restrict_to_fill_level);
Sets whether the slider is restricted to the fill level. See
gtk_range_set_fill_level()
for a general description of the fill
level concept.
range : |
A GtkRange |
restrict_to_fill_level : |
Whether the fill level restricts slider movement. |
Since 2.12
void gtk_range_set_show_fill_level (GtkRange *range,gboolean show_fill_level);
Sets whether a graphical fill level is show on the trough. See
gtk_range_set_fill_level()
for a general description of the fill
level concept.
range : |
A GtkRange |
show_fill_level : |
Whether a fill level indicator graphics is shown. |
Since 2.12
GtkAdjustment* gtk_range_get_adjustment (GtkRange *range);
Get the GtkAdjustment which is the "model" object for GtkRange.
See gtk_range_set_adjustment()
for details.
The return value does not have a reference added, so should not
be unreferenced.
range : |
a GtkRange |
Returns : | a GtkAdjustment |
void gtk_range_set_update_policy (GtkRange *range, GtkUpdateType policy);
Sets the update policy for the range.
range : |
a GtkRange |
policy : |
update policy |
void gtk_range_set_adjustment (GtkRange *range, GtkAdjustment *adjustment);
Sets the adjustment to be used as the "model" object for this range widget. 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.
range : |
a GtkRange |
adjustment : |
a GtkAdjustment |
gboolean gtk_range_get_inverted (GtkRange *range);
Gets the value set by gtk_range_set_inverted()
.
range : |
a GtkRange |
Returns : | TRUE |
void gtk_range_set_inverted (GtkRange *range,gboolean setting);
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.
range : |
a GtkRange |
setting : |
TRUE |
GtkUpdateType gtk_range_get_update_policy (GtkRange *range);
Gets the update policy of range
. See gtk_range_set_update_policy()
.
range : |
a GtkRange |
Returns : | the current update policy |
gdouble gtk_range_get_value (GtkRange *range);
Gets the current value of the range.
range : |
a GtkRange |
Returns : | current value of the range. |
void gtk_range_set_increments (GtkRange *range,gdouble step,gdouble page);
Sets the step and page sizes for the range. The step size is used when the user clicks the GtkScrollbar arrows or moves GtkScale via arrow keys. The page size is used for example when moving via Page Up or Page Down keys.
range : |
a GtkRange |
step : |
step size |
page : |
page size |
void gtk_range_set_range (GtkRange *range,gdouble min,gdouble max);
Sets the allowable values in the GtkRange, and clamps the range
value to be between min
and max
. (If the range has a non-zero
page size, it is clamped between min
and max
- page-size.)
range : |
a GtkRange |
min : |
minimum range value |
max : |
maximum range value |
void gtk_range_set_value (GtkRange *range,gdouble 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 ::value-changed signal if the value changes.
range : |
a GtkRange |
value : |
new value of the range |
typedef enum { GTK_SENSITIVITY_AUTO, GTK_SENSITIVITY_ON, GTK_SENSITIVITY_OFF } GtkSensitivityType;
Determines how GTK+ handles the sensitivity of stepper arrows at the end of range widgets.
void gtk_range_set_lower_stepper_sensitivity (GtkRange *range, GtkSensitivityType sensitivity);
Sets the sensitivity policy for the stepper that points to the 'lower' end of the GtkRange's adjustment.
range : |
a GtkRange |
sensitivity : |
the lower stepper's sensitivity policy. |
Since 2.10
GtkSensitivityType gtk_range_get_lower_stepper_sensitivity (GtkRange *range);
Gets the sensitivity policy for the stepper that points to the 'lower' end of the GtkRange's adjustment.
range : |
a GtkRange |
Returns : | The lower stepper's sensitivity policy. |
Since 2.10
void gtk_range_set_upper_stepper_sensitivity (GtkRange *range, GtkSensitivityType sensitivity);
Sets the sensitivity policy for the stepper that points to the 'upper' end of the GtkRange's adjustment.
range : |
a GtkRange |
sensitivity : |
the upper stepper's sensitivity policy. |
Since 2.10
GtkSensitivityType gtk_range_get_upper_stepper_sensitivity (GtkRange *range);
Gets the sensitivity policy for the stepper that points to the 'upper' end of the GtkRange's adjustment.
range : |
a GtkRange |
Returns : | The upper stepper's sensitivity policy. |
Since 2.10
adjustment
propertyadjustment GtkAdjustment : Read / Write / Construct
The GtkAdjustment that contains the current value of this range object.
fill-level
propertyfill-levelgdouble : Read / Write
The fill level (e.g. prebuffering of a network stream).
See gtk_range_set_fill_level()
.
Default value: 1.79769e+308
Since 2.12
inverted
propertyinvertedgboolean : Read / Write
Invert direction slider moves to increase range value.
Default value: FALSE
lower-stepper-sensitivity
propertylower-stepper-sensitivity GtkSensitivityType : Read / Write
The sensitivity policy for the stepper that points to the adjustment's lower side.
Default value: GTK_SENSITIVITY_AUTO
restrict-to-fill-level
propertyrestrict-to-fill-levelgboolean : Read / Write
The restrict-to-fill-level property controls whether slider
movement is restricted to an upper boundary set by the
fill level. See gtk_range_set_restrict_to_fill_level()
.
Default value: TRUE
Since 2.12
show-fill-level
propertyshow-fill-levelgboolean : Read / Write
The show-fill-level property controls whether fill level indicator
graphics are displayed on the trough. See
gtk_range_set_show_fill_level()
.
Default value: FALSE
Since 2.12
update-policy
propertyupdate-policy GtkUpdateType : Read / Write
How the range should be updated on the screen.
Default value: GTK_UPDATE_CONTINUOUS
upper-stepper-sensitivity
propertyupper-stepper-sensitivity GtkSensitivityType : Read / Write
The sensitivity policy for the stepper that points to the adjustment's upper side.
Default value: GTK_SENSITIVITY_AUTO
activate-slider
style propertyactivate-slidergboolean : Read
With this option set to TRUE, sliders will be drawn ACTIVE and with shadow IN while they are dragged.
Default value: FALSE
arrow-displacement-x
style propertyarrow-displacement-xgint : Read
How far in the x direction to move the arrow when the button is depressed.
Default value: 0
arrow-displacement-y
style propertyarrow-displacement-ygint : Read
How far in the y direction to move the arrow when the button is depressed.
Default value: 0
slider-width
style propertyslider-widthgint : Read
Width of scrollbar or scale thumb.
Allowed values: >= 0
Default value: 14
stepper-size
style propertystepper-sizegint : Read
Length of step buttons at ends.
Allowed values: >= 0
Default value: 14
stepper-spacing
style propertystepper-spacinggint : Read
The spacing between the stepper buttons and thumb. Note that
setting this value to anything > 0 will automatically set the
trough-under-steppers style property to TRUE
Allowed values: >= 0
Default value: 0
trough-border
style propertytrough-bordergint : Read
Spacing between thumb/steppers and outer trough bevel.
Allowed values: >= 0
Default value: 1
trough-side-details
style propertytrough-side-detailsgboolean : Read
When TRUE
Default value: FALSE
Since 2.10
trough-under-steppers
style propertytrough-under-steppersgboolean : Read
Whether to draw the trough across the full length of the range or to exclude the steppers and their spacing. Note that setting the :stepper-spacing style property to any value > 0 will automatically enable trough-under-steppers too.
Default value: TRUE
Since 2.10
::adjust-bounds
signalvoid user_function (GtkRange *range,gdouble arg1,gpointer user_data) : Run Last
range : |
the object which received the signal. |
arg1 : |
|
user_data : |
user data set when the signal handler was connected. |
::change-value
signalgboolean user_function (GtkRange *range, GtkScrollType scroll,gdouble value,gpointer user_data) : Run Last
The ::change-value signal is emitted when a scroll action is
performed on a range. It allows an application to determine the
type of scroll event that occurred and the resultant new value.
The application can handle the event itself and return TRUE
FALSE
The value parameter is unrounded. An application that overrides
the ::change-value signal is responsible for clamping the value to
the desired number of decimal digits; the default GTK+ handler
clamps the value based on range->round_digits
.
It is not possible to use delayed update policies in an overridden ::change-value handler.
range : |
the range that received the signal |
scroll : |
the type of scroll action that was performed |
value : |
the new value resulting from the scroll action |
returns : |
TRUE FALSE |
user_data : |
user data set when the signal handler was connected. |
Since 2.6
::move-slider
signalvoid user_function (GtkRange *range, GtkScrollType arg1,gpointer user_data) : Run Last / Action
Virtual function that moves the slider. Used for keybindings.
range : |
the GtkRange |
arg1 : |
|
user_data : |
user data set when the signal handler was connected. |