Gtk.Adjustment¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
The minimum value of the adjustment |
||
r/w |
The page increment of the adjustment |
||
r/w |
The page size of the adjustment |
||
r/w |
The step increment of the adjustment |
||
r/w |
The maximum value of the adjustment |
||
r/w |
The value of the adjustment |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when one or more of the |
|
Emitted when the |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Gtk.Adjustment(*args, **kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The
Gtk.Adjustment
object represents a value which has an associated lower and upper bound, together with step and page increments, and a page size. It is used within several GTK+ widgets, includingGtk.SpinButton
,Gtk.Viewport
, andGtk.Range
(which is a base class forGtk.Scrollbar
andGtk.Scale
).The
Gtk.Adjustment
object does not update the value itself. Instead it is left up to the owner of theGtk.Adjustment
to control the value.- classmethod new(value, lower, upper, step_increment, page_increment, page_size)[source]¶
- Parameters:
- Returns:
a new
Gtk.Adjustment
- Return type:
Creates a new
Gtk.Adjustment
.
- changed()[source]¶
Emits a
Gtk.Adjustment
::changed
signal from theGtk.Adjustment
. This is typically called by the owner of theGtk.Adjustment
after it has changed any of theGtk.Adjustment
properties other than the value.Deprecated since version 3.18: GTK+ emits
Gtk.Adjustment
::changed
itself whenever any of the properties (other than value) change
- clamp_page(lower, upper)[source]¶
-
Updates the
Gtk.Adjustment
:value
property to ensure that the range between lower and upper is in the current page (i.e. betweenGtk.Adjustment
:value
andGtk.Adjustment
:value
+Gtk.Adjustment
:page-size
). If the range is larger than the page size, then only the start of it will be in the current page.A
Gtk.Adjustment
::value-changed
signal will be emitted if the value is changed.
- configure(value, lower, upper, step_increment, page_increment, page_size)[source]¶
- Parameters:
Sets all properties of the adjustment at once.
Use this function to avoid multiple emissions of the
Gtk.Adjustment
::changed
signal. SeeGtk.Adjustment.set_lower
() for an alternative way of compressing multiple emissions ofGtk.Adjustment
::changed
into one.New in version 2.14.
- get_lower()[source]¶
- Returns:
The current minimum value of the adjustment
- Return type:
Retrieves the minimum value of the adjustment.
New in version 2.14.
- get_minimum_increment()[source]¶
- Returns:
the minimum increment of self
- Return type:
Gets the smaller of step increment and page increment.
New in version 3.2.
- get_page_increment()[source]¶
- Returns:
The current page increment of the adjustment
- Return type:
Retrieves the page increment of the adjustment.
New in version 2.14.
- get_page_size()[source]¶
- Returns:
The current page size of the adjustment
- Return type:
Retrieves the page size of the adjustment.
New in version 2.14.
- get_step_increment()[source]¶
- Returns:
The current step increment of the adjustment.
- Return type:
Retrieves the step increment of the adjustment.
New in version 2.14.
- get_upper()[source]¶
- Returns:
The current maximum value of the adjustment
- Return type:
Retrieves the maximum value of the adjustment.
New in version 2.14.
- get_value()[source]¶
- Returns:
The current value of the adjustment
- Return type:
Gets the current value of the adjustment. See
Gtk.Adjustment.set_value
().
- set_lower(lower)[source]¶
- Parameters:
lower (
float
) – the new minimum value
Sets the minimum value of the adjustment.
When setting multiple adjustment properties via their individual setters, multiple
Gtk.Adjustment
::changed
signals will be emitted. However, since the emission of theGtk.Adjustment
::changed
signal is tied to the emission of theGObject.Object
::notify
signals of the changed properties, it’s possible to compress theGtk.Adjustment
::changed
signals into one by callingGObject.Object.freeze_notify
() andGObject.Object.thaw_notify
() around the calls to the individual setters.Alternatively, using a single g_object_set() for all the properties to change, or using
Gtk.Adjustment.configure
() has the same effect of compressingGtk.Adjustment
::changed
emissions.New in version 2.14.
- set_page_increment(page_increment)[source]¶
- Parameters:
page_increment (
float
) – the new page increment
Sets the page increment of the adjustment.
See
Gtk.Adjustment.set_lower
() about how to compress multiple emissions of theGtk.Adjustment
::changed
signal when setting multiple adjustment properties.New in version 2.14.
- set_page_size(page_size)[source]¶
- Parameters:
page_size (
float
) – the new page size
Sets the page size of the adjustment.
See
Gtk.Adjustment.set_lower
() about how to compress multiple emissions of theGtk.Adjustment
::changed
signal when setting multiple adjustment properties.New in version 2.14.
- set_step_increment(step_increment)[source]¶
- Parameters:
step_increment (
float
) – the new step increment
Sets the step increment of the adjustment.
See
Gtk.Adjustment.set_lower
() about how to compress multiple emissions of theGtk.Adjustment
::changed
signal when setting multiple adjustment properties.New in version 2.14.
- set_upper(upper)[source]¶
- Parameters:
upper (
float
) – the new maximum value
Sets the maximum value of the adjustment.
Note that values will be restricted by
upper - page-size
if the page-size property is nonzero.See
Gtk.Adjustment.set_lower
() about how to compress multiple emissions of theGtk.Adjustment
::changed
signal when setting multiple adjustment properties.New in version 2.14.
- set_value(value)[source]¶
- Parameters:
value (
float
) – the new value
Sets the
Gtk.Adjustment
value. The value is clamped to lie betweenGtk.Adjustment
:lower
andGtk.Adjustment
:upper
.Note that for adjustments which are used in a
Gtk.Scrollbar
, the effective range of allowed values goes fromGtk.Adjustment
:lower
toGtk.Adjustment
:upper
-Gtk.Adjustment
:page-size
.
- value_changed()[source]¶
Emits a
Gtk.Adjustment
::value-changed
signal from theGtk.Adjustment
. This is typically called by the owner of theGtk.Adjustment
after it has changed theGtk.Adjustment
:value
property.Deprecated since version 3.18: GTK+ emits
Gtk.Adjustment
::value-changed
itself whenever the value changes
- do_changed() virtual¶
Emits a
Gtk.Adjustment
::changed
signal from theGtk.Adjustment
. This is typically called by the owner of theGtk.Adjustment
after it has changed any of theGtk.Adjustment
properties other than the value.Deprecated since version 3.18: GTK+ emits
Gtk.Adjustment
::changed
itself whenever any of the properties (other than value) change
- do_value_changed() virtual¶
Emits a
Gtk.Adjustment
::value-changed
signal from theGtk.Adjustment
. This is typically called by the owner of theGtk.Adjustment
after it has changed theGtk.Adjustment
:value
property.Deprecated since version 3.18: GTK+ emits
Gtk.Adjustment
::value-changed
itself whenever the value changes
Signal Details¶
- Gtk.Adjustment.signals.changed(adjustment)¶
- Signal Name:
changed
- Flags:
- Parameters:
adjustment (
Gtk.Adjustment
) – The object which received the signal
Emitted when one or more of the
Gtk.Adjustment
properties have been changed, other than theGtk.Adjustment
:value
property.
- Gtk.Adjustment.signals.value_changed(adjustment)¶
- Signal Name:
value-changed
- Flags:
- Parameters:
adjustment (
Gtk.Adjustment
) – The object which received the signal
Emitted when the
Gtk.Adjustment
:value
property has been changed.
Property Details¶
- Gtk.Adjustment.props.lower¶
-
The minimum value of the adjustment.
New in version 2.4.
- Gtk.Adjustment.props.page_increment¶
-
The page increment of the adjustment.
New in version 2.4.
- Gtk.Adjustment.props.page_size¶
-
The page size of the adjustment. Note that the page-size is irrelevant and should be set to zero if the adjustment is used for a simple scalar value, e.g. in a
Gtk.SpinButton
.New in version 2.4.
- Gtk.Adjustment.props.step_increment¶
-
The step increment of the adjustment.
New in version 2.4.
- Gtk.Adjustment.props.upper¶
-
The maximum value of the adjustment. Note that values will be restricted by
upper - page-size
if the page-size property is nonzero.New in version 2.4.