Gtk.Adjustment¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when one or more of the |
|
Emitted when the value has been changed. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Gtk.Adjustment(*args, **kwargs)¶
- Bases:
- Abstract:
No
- Structure:
GtkAdjustment
is a model for a numeric value.The
GtkAdjustment
has an associated lower and upper bound. It also contains step and page increments, and a page size.Adjustments are used within several GTK widgets, including [class`Gtk`.SpinButton], [class`Gtk`.Viewport], [class`Gtk`.Scrollbar] and [class`Gtk`.Scale].
The
GtkAdjustment
object does not update the value itself. Instead it is left up to the owner of theGtkAdjustment
to control the value.- classmethod new(value, lower, upper, step_increment, page_increment, page_size)[source]¶
- Parameters:
- Returns:
a new
GtkAdjustment
- Return type:
Creates a new
GtkAdjustment
.
- clamp_page(lower, upper)[source]¶
-
Updates the value property to ensure that the range between lower and upper is in the current page.
The current page goes from
value
tovalue
+page-size
. If the range is larger than the page size, then only the start of it will be in the current page.A [signal`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 [signal`Gtk`.Adjustment::changed] signal. See [method`Gtk`.Adjustment.set_lower] for an alternative way of compressing multiple emissions of [signal`Gtk`.Adjustment::changed] into one.
- get_lower()[source]¶
- Returns:
The current minimum value of the adjustment
- Return type:
Retrieves the minimum value of the adjustment.
- get_minimum_increment()[source]¶
- Returns:
the minimum increment of self
- Return type:
Gets the smaller of step increment and page increment.
- get_page_increment()[source]¶
- Returns:
The current page increment of the adjustment
- Return type:
Retrieves the page increment of the adjustment.
- get_page_size()[source]¶
- Returns:
The current page size of the adjustment
- Return type:
Retrieves the page size of the adjustment.
- get_step_increment()[source]¶
- Returns:
The current step increment of the adjustment.
- Return type:
Retrieves the step increment of the adjustment.
- get_upper()[source]¶
- Returns:
The current maximum value of the adjustment
- Return type:
Retrieves the maximum value of the adjustment.
- get_value()[source]¶
- Returns:
The current value of the adjustment
- Return type:
Gets the current value of the adjustment.
- 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 [signal`Gtk`.Adjustment::changed] signals will be emitted. However, since the emission of the [signal`Gtk`.Adjustment::changed] signal is tied to the emission of the
::notify
signals of the changed properties, it’s possible to compress the [signal`Gtk`.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 [method`Gtk`.Adjustment.configure] has the same effect.
- set_page_increment(page_increment)[source]¶
- Parameters:
page_increment (
float
) – the new page increment
Sets the page increment of the adjustment.
See [method`Gtk`.Adjustment.set_lower] about how to compress multiple emissions of the [signal`Gtk`.Adjustment::changed] signal when setting multiple adjustment properties.
- set_page_size(page_size)[source]¶
- Parameters:
page_size (
float
) – the new page size
Sets the page size of the adjustment.
See [method`Gtk`.Adjustment.set_lower] about how to compress multiple emissions of the [signal`Gtk`.Adjustment::changed] signal when setting multiple adjustment properties.
- set_step_increment(step_increment)[source]¶
- Parameters:
step_increment (
float
) – the new step increment
Sets the step increment of the adjustment.
See [method`Gtk`.Adjustment.set_lower] about how to compress multiple emissions of the [signal`Gtk`.Adjustment::changed] signal when setting multiple adjustment properties.
- 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 [method`Gtk`.Adjustment.set_lower] about how to compress multiple emissions of the [signal`Gtk`.Adjustment::changed] signal when setting multiple adjustment properties.
- set_value(value)[source]¶
- Parameters:
value (
float
) – the new value
Sets the
GtkAdjustment
value.The value is clamped to lie between [property`Gtk`.Adjustment:lower] and [property`Gtk`.Adjustment:upper].
Note that for adjustments which are used in a
GtkScrollbar
, the effective range of allowed values goes from [property`Gtk`.Adjustment:lower] to [property`Gtk`.Adjustment:upper] - [property`Gtk`.Adjustment:page-size].
- do_changed() virtual¶
- do_value_changed() virtual¶
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
GtkAdjustment
properties have been changed.Note that the [property`Gtk`.Adjustment:value] property is covered by the [signal`Gtk`.Adjustment::value-changed] signal.
- Gtk.Adjustment.signals.value_changed(adjustment)¶
- Signal Name:
value-changed
- Flags:
- Parameters:
adjustment (
Gtk.Adjustment
) – The object which received the signal
Emitted when the value has been changed.
Property Details¶
- Gtk.Adjustment.props.lower¶
-
The minimum value of the adjustment.
- Gtk.Adjustment.props.page_increment¶
-
The page increment of the adjustment.
- 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
GtkSpinButton
.
- Gtk.Adjustment.props.step_increment¶
-
The step increment of the adjustment.
- 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.