This object represents an adjustable bounded value. It is used in many other widgets that have such internal values, like Gtk_Scrollbar, Gtk_Spin_Button, Gtk_Range, ... Modifying the value of these widgets is done through their associated adjustments.
The modification of the value is left to the user, who should call Value_Changed or Changed to emit the relevant signals.
The meaning of the most important fields can be explained on the following figure (imagine this is a scrollbar):
[-------|=================|-------------------] lower value value + page_size upper
Widget Hierarchy |
---|
GObject (see section Package Glib.Object) Gtk_Object (see section Package Gtk.Object) \___ Gtk_Adjustment (see section Package Gtk.Adjustment) |
Signals |
---|
Subprograms |
---|
procedure Gtk_New (Adjustment : out Gtk_Adjustment; Value : Gdouble; Lower : Gdouble; Upper : Gdouble; Step_Increment : Gdouble; Page_Increment : Gdouble; Page_Size : Gdouble); | ||
Create a new adjustment. | ||
function Get_Type return Gtk.Gtk_Type; | ||
Return the internal value associated with a Gtk_Adjustment.
| ||
Read functions | ||
function Get_Value (Adjustment : access Gtk_Adjustment_Record) return Gdouble; | ||
Return the current value of the adjustment.
| ||
function Get_Lower (Adjustment : access Gtk_Adjustment_Record) return Gdouble; | ||
Return the lower bound of the adjustment.
| ||
function Get_Upper (Adjustment : access Gtk_Adjustment_Record) return Gdouble; | ||
Return the upper bound of the adjustment.
| ||
function Get_Step_Increment (Adjustment : access Gtk_Adjustment_Record) return Gdouble; | ||
Return the step increment of the adjustment.
| ||
function Get_Page_Increment (Adjustment : access Gtk_Adjustment_Record) return Gdouble; | ||
Return the page increment of the adjustment.
| ||
function Get_Page_Size (Adjustment : access Gtk_Adjustment_Record) return Gdouble; | ||
Return the page size of the adjustment.
| ||
Write functions | ||
procedure Set_Value (Adjustment : access Gtk_Adjustment_Record; Value : Gdouble); | ||
Modify the current value of the adjustment. | ||
procedure Set_Lower (Adjustment : access Gtk_Adjustment_Record; Lower : Gdouble); | ||
Modify the lower bound of the adjustment. | ||
procedure Set_Upper (Adjustment : access Gtk_Adjustment_Record; Upper : Gdouble); | ||
Modify the upper bound of the adjustment. | ||
procedure Set_Step_Increment (Adjustment : access Gtk_Adjustment_Record; Step_Increment : Gdouble); | ||
Modify the step increment of the adjustment. | ||
procedure Set_Page_Increment (Adjustment : access Gtk_Adjustment_Record; Page_Increment : Gdouble); | ||
Modify the page increment of the adjustment. | ||
procedure Set_Page_Size (Adjustment : access Gtk_Adjustment_Record; Page_Size : Gdouble); | ||
Modify the page size of the adjustment. | ||
Misc functions | ||
procedure Clamp_Page (Adjustment : access Gtk_Adjustment_Record; Lower : Gdouble; Upper : Gdouble); | ||
Update the Adjustment value to ensure that the range between Lower and | ||
Signals emission | ||
procedure Changed (Adjustment : access Gtk_Adjustment_Record); | ||
Emit the "changed" signal on Adjustment. | ||
procedure Value_Changed (Adjustment : access Gtk_Adjustment_Record); | ||
Emit the "value_changed" signal on Adjustment. |
Example |
---|
[-------|=================|-------------------] lower value value + page_size upper