gtk.Range
gtk.Range — a base class for widgets that allow a user to set a value in
a range.
gtk.Range Signal Prototypes
gobject.GObject Signal Prototypes
gtk.Object Signal Prototypes
gtk.Widget Signal Prototypes
"adjust-bounds" | def callback(range, value, user_param1, ...) |
"change-value | def callback(range, scroll, value, arg1, arg2, user_param1, ...) |
"move-slider" | def callback(range, scrolltype, user_param1, ...) |
"value-changed" | def callback(range, user_param1, ...) |
Methods
gtk.Range.set_update_policy
def set_update_policy(policy)
|
policy : | the update policy:
gtk.UPDATE_CONTINUOUS,
gtk.UPDATE_DISCONTINUOUS,
gtk.UPDATE_DELAYED |
The set_update_policy() method sets the
"update-policy" property to the value specified by
policy. The update policy has the following values
and effects:
gtk.UPDATE_CONTINUOUS | anytime the range slider is moved, the range value will
change and the "value_changed" signal will be emitted. |
gtk.UPDATE_DELAYED | the value will be updated after a brief timeout where
no slider motion occurs, so value changes are delayed slightly rather than
continuously updated. |
gtk.UPDATE_DISCONTINUOUS | the value will only be updated when the user releases
the button and ends the slider drag operation. |
gtk.Range.get_update_policy
Returns : | the current update policy |
The get_update_policy() method gets the
value of the "update-policy" property. The update policy is one of:
gtk.UPDATE_CONTINUOUS,
gtk.UPDATE_DISCONTINUOUS or
gtk.UPDATE_DELAYED. See the set_update_policy()
method for details.
gtk.Range.set_adjustment
def set_adjustment(adjustment)
|
The set_adjustment() method sets the
"adjustment" property to the value specified by
adjustment. The gtk.Adjustment
is used as the "model" object for this range widget.
adjustment indicates the current range value, the
minimum and maximum range values, the step and page increments used for
keybindings and scrolling, and the page size. The page size is normally 0
for gtk.Scale
and nonzero for gtk.Scrollbar,
and indicates the size of the visible area of the widget being scrolled. The
page size affects the size of the scrollbar slider.
gtk.Range.get_adjustment
The get_adjustment() method returns the
value of the "adjustment" property. See the set_adjustment()
method for details.
gtk.Range.set_inverted
def set_inverted(setting)
|
setting : | if TRUE invert the
range |
The set_inverted() method sets the
"inverted" property to the value specified by
setting. If setting is
TRUE the normal motion of the range widget is reversed.
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 left rather than on the bottom or right.
gtk.Range.get_inverted
Returns : | TRUE if the range is
inverted |
The get_inverted() method returns the
value of the "inverted" property that was set by the set_inverted()
method.
gtk.Range.set_increments
def set_increments(step, page)
|
step : | the step size |
page : | the page size |
The set_increments() method sets the
step and page sizes for the range to the values specified by
step and page respectively.
The step size is used when the user clicks the gtk.Scrollbar
arrows or moves gtk.Scale via the
arrow keys. The page size is used for example when moving via Page
Up or Page Down keys.
gtk.Range.set_range
min : | the minimum range value |
max : | the maximum range value |
The set_range() method sets the minimum
and maximum allowable values for the gtk.Range to that
values specified by min and
max respectively. If the range has a non-zero page
size, it is also forced to be between min and
max.
gtk.Range.set_value
value : | the new value of the range |
The set_value() method sets the current
value of the range to the value specified by value.
value will be forced inside the minimum or maximum
range values. The range emits the "value_changed" signal if the value
changes.
gtk.Range.get_value
Returns : | the current value of the
range. |
The get_value() method gets the current
value of the range.
Signals
The "adjust-bounds" gtk.Range Signal
def callback(range, value, user_param1, ...)
|
range : | the range that received the
signal |
value : | the value |
user_param1 : | the first user parameter (if any) specified
with the connect()
method |
... : | additional user parameters (if
any) |
The "adjust-bounds" signal is emitted when the range is adjusted
by user action. Note the value can be more or less than the range since it
depends on the mouse position.
The "change-value" gtk.Range Signal
def callback(range, scroll, value, user_param1, ...)
|
range : | the range that received the signal. the object
which received the signal. |
scroll : | the type of scroll action that was performed -
one of the GTK Scroll Type Constants.. |
value : | the new value resulting from the scroll
action. |
user_param1 : | the first user parameter (if any) specified
with the connect()
method |
... : | additional user parameters (if any) |
Returns : | TRUE to prevent other
handlers from being invoked for the signal or
FALSE to propagate the signal
further. |
Note
This signal is available in GTK+ 2.6 and above.
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 to prevent further processing. Or, by
returning FALSE, it can pass the event to other
handlers until the default GTK+ handler is reached.
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.
It is not possible to use delayed update policies in an
overridden "change-value" handler.
The "move-slider" gtk.Range Signal
def callback(range, scrolltype, user_param1, ...)
|
range : | the range that received the
signal |
scrolltype : | the scroll type issued because a key was
pressed by the user; one of the GTK Scroll Type Constants. |
user_param1 : | the first user parameter (if any) specified
with the connect()
method |
... : | additional user parameters (if
any) |
The "move-slider" signal is emitted when the user presses a key
(e.g. Page Up, Home, Right
Arrow) to move the slider.
The "value-changed" gtk.Range Signal
def callback(range, user_param1, ...)
|
range : | the range that received the
signal |
user_param1 : | the first user parameter (if any) specified
with the connect()
method |
... : | additional user parameters (if
any) |
The "value-changed" signal is emitted when the range value is
changed either programmatically or by user action.