GtkAdjustment

Name

GtkAdjustment -- a GtkObject representing an adjustable bounded value.

Synopsis


#include <gtk/gtk.h>


struct      GtkAdjustment;
GtkObject*  gtk_adjustment_new              (gdouble value,
                                             gdouble lower,
                                             gdouble upper,
                                             gdouble step_increment,
                                             gdouble page_increment,
                                             gdouble page_size);
gdouble     gtk_adjustment_get_value        (GtkAdjustment *adjustment);
void        gtk_adjustment_set_value        (GtkAdjustment *adjustment,
                                             gdouble value);
void        gtk_adjustment_clamp_page       (GtkAdjustment *adjustment,
                                             gdouble lower,
                                             gdouble upper);
void        gtk_adjustment_changed          (GtkAdjustment *adjustment);
void        gtk_adjustment_value_changed    (GtkAdjustment *adjustment);


Object Hierarchy


  GObject
   +----GtkObject
         +----GtkAdjustment

Signal Prototypes


"changed"   void        user_function      (GtkAdjustment *adjustment,
                                            gpointer user_data);
"value-changed"
            void        user_function      (GtkAdjustment *adjustment,
                                            gpointer user_data);

Description

The GtkAdjustment 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, including GtkSpinButton, GtkViewport, and GtkRange (which is a base class for GtkHScrollbar, GtkVScrollbar, GtkHScale, and GtkVScale).

The GtkAdjustment object does not update the value itself. Instead it is left up to the owner of the GtkAdjustment to control the value.

The owner of the GtkAdjustment typically calls the gtk_adjustment_value_changed() and gtk_adjustment_changed() functions after changing the value and its bounds. This results in the emission of the "value_changed" or "changed" signal respectively.

Details

struct GtkAdjustment

struct GtkAdjustment;

The GtkAdjustment struct contains the following fields.


gtk_adjustment_new ()

GtkObject*  gtk_adjustment_new              (gdouble value,
                                             gdouble lower,
                                             gdouble upper,
                                             gdouble step_increment,
                                             gdouble page_increment,
                                             gdouble page_size);

Creates a new GtkAdjustment.


gtk_adjustment_get_value ()

gdouble     gtk_adjustment_get_value        (GtkAdjustment *adjustment);

Gets the current value of the adjustment. See gtk_adjustment_set_value().


gtk_adjustment_set_value ()

void        gtk_adjustment_set_value        (GtkAdjustment *adjustment,
                                             gdouble value);

Sets the GtkAdjustment value.


gtk_adjustment_clamp_page ()

void        gtk_adjustment_clamp_page       (GtkAdjustment *adjustment,
                                             gdouble lower,
                                             gdouble upper);

Updates the GtkAdjustment 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_changed ()

void        gtk_adjustment_changed          (GtkAdjustment *adjustment);

Emits a "changed" signal from the GtkAdjustment. This is typically called by the owner of the GtkAdjustment after it has changed any of the GtkAdjustment fields other than the value.


gtk_adjustment_value_changed ()

void        gtk_adjustment_value_changed    (GtkAdjustment *adjustment);

Emits a "value_changed" signal from the GtkAdjustment. This is typically called by the owner of the GtkAdjustment after it has changed the GtkAdjustment value field.

Signals

The "changed" signal

void        user_function                  (GtkAdjustment *adjustment,
                                            gpointer user_data);

Emitted when one or more of the GtkAdjustment fields have been changed, other than the value field.


The "value-changed" signal

void        user_function                  (GtkAdjustment *adjustment,
                                            gpointer user_data);

Emitted when the GtkAdjustment value field has been changed.