gtk.Adjustmentan object representing an adjustable bounded
valueSynopsisgtk.Adjustmentgtk.Objectgtk.Adjustmentvalue0lower0upper0step_incr0page_incr0page_size0set_allvaluelowerupperstep_incrementpage_incrementpage_sizechangedvalue_changedclamp_pagelowerupperget_valueset_valuevalueconfigurevaluelowerupperstep_incrementpage_incrementpage_sizeget_lowerset_lowerlowerget_page_incrementset_page_incrementpage_incrementget_page_sizeset_page_sizepage_sizeget_step_incrementset_step_incrementstep_incrementget_upperset_upperupperAncestry+-- gobject.GObject
+-- gtk.Object
+-- gtk.Adjustment
gtk.Adjustment Propertiesgtk.Object PropertiesThese properties are available in GTK+ 2.4 and above. The GTK+
version is contained in the 3-tuple gtk.gtk_version.
"lower"Read-WriteThe minimum value of the adjustment. (float)"page-increment"Read-WriteThe page increment of the adjustment. (float)"page-size"Read-WriteThe page size of the adjustment. (float)"step-increment"Read-WriteThe step increment of the adjustment. (float)"upper"Read-WriteThe maximum value of the adjustment. (float)"value"Read-WriteThe value of the adjustment. (float)
Attributes
"value"Read-Writethe current value (float)"lower"Read-Writethe minimum value (float)"upper"Read-Writethe maximum value (float)"step_increment"Read-Writethe increment to use to make minor changes to the
value. In a gtk.Scrollbar
this increment is used when the mouse is clicked on the arrows at the top
and bottom of the scrollbar, to scroll by a small amount. (float)"page_increment"Read-Writethe increment to use to make major changes to the
value. In a gtk.Scrollbar
this increment is used when the mouse is clicked in the trough, to scroll by
a large amount. (float)"page_size"Read-Writea widget specific size. In a gtk.Scrollbar
this is the size of the area which is currently visible. (float)
gtk.Adjustment Signal Prototypesgobject.GObject Signal Prototypesgtk.Object Signal Prototypes"changed"callbackadjustmentuser_param1..."value-changed"callbackadjustmentuser_param1...DescriptionThe gtk.Adjustment
object contains a value which has an associated lower and upper bound,
together with step and page increments, and a page size. It is used in
conjunction with several PyGTK widgets, including gtk.SpinButton,
gtk.Viewport,
and gtk.Range (which
is a base class for gtk.HScrollbar,
gtk.VScrollbar,
gtk.HScale, and
gtk.VScale).A gtk.Adjustment
can be shared by multiple widgets. The gtk.Adjustment
object does not update the value itself. Instead it is left up to the
associated widget(s) that use the gtk.Adjustment
to control the value.The widget using the gtk.Adjustment
typically calls the value_changed()
or changed()
methods after changing the value or its bounds. This results in the emission
of the "value_changed" or "changed" signal respectively.A gtk.Adjustment
object contains several attributes that provide access to its value and
bounds:valuelowerupperstep_incrementpage_incrementpage_sizeThe attribute values can be retrieved and set similar to:
adjustment.upper = 25.0
lower = adjustment.lower
Constructorgtk.Adjustmentvalue0lower0upper0step_incr0page_incr0page_size0value :the initial value.lower :the minimum value.upper :the maximum value.step_incr :the step increment.page_incr :the page increment.page_size :the page size.Returns :a new gtk.Adjustment objectgtk.Adjustment() creates a new gtk.Adjustment
object with the specified attributes. Any attributes not specified are set
to 0.0 by default.Methodsgtk.Adjustment.set_allset_allvaluelowerupperstep_incrementpage_incrementpage_sizevalue :the new value.lower :the new minimum value.upper :the new maximum value.step_increment :the new step increment.page_increment :the new page increment.page_size :the new page size.The set_all() method sets the
attributes of the adjustment to the specified values.gtk.Adjustment.changedchangedThe changed() method emits a "changed"
signal from the adjustment. This must typically be called if any of the
adjustment attributes other than value has changed so that the widget(s)
using the adjustment can reflect the changes. Applications usually will not
need to use this method since setting the attributes directly will automatically
invoke this method.gtk.Adjustment.value_changedvalue_changedThe value_changed() method emits a
"value_changed" signal from the adjustment. This must typically be called
after the value attribute of the adjustment has changed. Applications
usually will not need to use this method since setting the attribute
directly will automatically invoke this method as will using the set_value()
method.gtk.Adjustment.clamp_pageclamp_pagelowerupperlower :the lower valueupper :the upper valueThe clamp_page() method updates the
adjustment value to ensure that the range between
lower and upper is in the
current page (i.e. between value and value + page_size). If the range is
larger than the page size, then only the start of it will be in the current
page. A "changed" signal will be emitted if the value is changed.gtk.Adjustment.get_valueget_valueReturns :The current value of the
adjustment.The get_value() method gets the current
value of the adjustment.gtk.Adjustment.set_valueset_valuevaluevalue :the new valueThe set_value() method sets the value
of the adjustment to the specified value.gtk.Adjustment.get_lowerget_lowerReturns :The current minimum value of the adjustment.This method is available in PyGTK 2.14 and above.The get_lower() method gets the current minimum
value of the adjustment.gtk.Adjustment.set_lowerset_lowerlowerlower :the new minimum valueThis method is available in PyGTK 2.14 and above.
The set_lower() method sets the minimum value of the adjustment.
When setting multiple adjustment properties via their individual setters,
multiple "changed" signals will be emitted. However, since the emission of the
"changed" signal is tied to the emission of the "GObject::notify"
signals of the changed properties, it's possible to compress the "changed"
signals into one by calling gobject.Gobject.freeze_notify() and gobject.Gobject.thaw_notify()
around the calls to the individual setters.
Alternatively, using
gtk.Adjustment.configure()
has the same effect of compressing "changed" emissions.
gtk.Adjustment.get_page_incrementget_page_incrementReturns :The current page increment of the adjustment.This method is available in PyGTK 2.14 and above.The get_page_increment() method gets the current page
increment of the adjustment.gtk.Adjustment.set_page_incrementset_page_incrementpage_incrementpage_increment :the new page increment valueThis method is available in PyGTK 2.14 and above.
The set_page_increment() method sets the page increment of the adjustment.
See
gtk.Adjustment.get_lower()
about how to compress multiple emissions of the "changed" signal when setting multiple adjustment properties.
gtk.Adjustment.get_page_sizeget_page_sizeReturns :The current page size of the adjustment.This method is available in PyGTK 2.14 and above.The get_page_size() method gets the current page
size of the adjustment.gtk.Adjustment.set_page_sizeset_page_sizepage_sizepage_size :the new page size valueThis method is available in PyGTK 2.14 and above.
The set_page_size() method sets the page size of the adjustment.
See
gtk.Adjustment.get_lower()
about how to compress multiple emissions of the "changed" signal when setting multiple adjustment properties.
gtk.Adjustment.get_step_incrementget_step_incrementReturns :The current step increment of the adjustment.This method is available in PyGTK 2.14 and above.The get_step_increment() method gets the current step
increment of the adjustment.gtk.Adjustment.set_step_incrementset_step_incrementstep_incrementstep_increment :the new step increment valueThis method is available in PyGTK 2.14 and above.
The set_step_increment() method sets the step increment of the adjustment.
See
gtk.Adjustment.get_lower()
about how to compress multiple emissions of the "changed" signal when setting multiple adjustment properties.
gtk.Adjustment.get_upperget_upperReturns :The current minimum value of the adjustment.This method is available in PyGTK 2.14 and above.The get_upper() method gets the current minimum
value of the adjustment.gtk.Adjustment.set_upperset_upperupperupper :the new maximum valueThis method is available in PyGTK 2.14 and above.
The set_upper() method 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.get_lower()
about how to compress multiple emissions of the "changed" signal when setting multiple adjustment properties.
SignalsThe "changed" gtk.Adjustment Signalcallbackadjustmentuser_param1...adjustment :the object that received the
signaluser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)The "changed" signal is emitted when one (or more) of the
adjustment attributes (except the value attribute) has changed.The "value-changed" gtk.Adjustment Signalcallbackadjustmentuser_param1...adjustment :the object that received the
signaluser_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 adjustment value
attribute has changed.