gtkmm 2.4: Gtk::Adjustment Class Reference

Main Page Widgets Namespaces Book

# Gtk::Adjustment Class Reference

Inheritance diagram for Gtk::Adjustment:

[legend]
List of all members.

## Detailed Description

A class representing an adjustable bounded value.

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 gtkmm widgets, including Gtk::SpinButton, Gtk::Viewport, and Gtk::Range (which is a base class for Gtk::HScrollbar, Gtk::VScrollbar, Gtk::HScale, and Gtk::VScale).

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

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

## Public Member Functions
| Adjustment (double value, double lower, double upper, double step_increment=1, double page_increment=10, double page_size=0)
| Constructor to create an Adjustment object.
void | changed ()
| Emits a "changed" signal from the Adjustment.
void | clamp_page (double lower, double upper)
| Updates the Adjustment value to ensure that the range between the parameters lower and upper is in the current page (i.e. between value and value + page_size ).
double | get_lower () const
| Retrieve the lower member variable.
double | get_page_increment () const
| Retrieve the page_increment variable.
double | get_page_size () const
| Retrieve the page_size variable.
double | get_step_increment () const
| Retrieve the step_increment variable.
double | get_upper () const
| Retrieve the upper member variable.
double | get_value () const
| Gets the current value of the adjustment.
const GtkAdjustment* | gobj () const
| Provides access to the underlying C GtkObject.
GtkAdjustment* | gobj ()
| Provides access to the underlying C GtkObject.
void | set_lower (double lower)
| Sets the lower member variable.
void | set_page_increment (double incr)
| Sets the page_increment member variable.
void | set_page_size (double size)
| Sets the page_size member variable.
void | set_step_increment (double incr)
| Sets the step_increment member variable.
void | set_upper (double upper)
| Sets the upper member variable.
void | set_value (double value)
| Sets the current value of the Adjustment.
Glib::SignalProxy0<void> | signal_changed ()
| Prototype: `void on_my_changed()`
Glib::SignalProxy0<void> | signal_value_changed ()
| Prototype: `void on_my_value_changed()`
void | value_changed ()
| Emits a "value_changed" signal from the Adjustment.
virtual | ~Adjustment ()
## Protected Member Functions
virtual void | on_changed ()
virtual void | on_value_changed ()
## Friends
class | HScrollbar
class | Range
class | VScrollbar
## Related Functions
(Note that these are not member functions.)
Gtk::Adjustment* | wrap (GtkAdjustment* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Constructor & Destructor Documentation

virtual Gtk::Adjustment::~Adjustment | ( |  | ) | `[virtual]`

Gtk::Adjustment::Adjustment | ( | double | value,
|  | double | lower,
|  | double | upper,
|  | double | step_increment = `1`,
|  | double | page_increment = `10`,
|  | double | page_size = `0` |
| ) |  |  |

Constructor to create an Adjustment object.

Parameters:

  | value | The initial value
  | lower | The minimum value
  | upper | The maximum value
  | step_increment | The step increment
  | page_increment | The page increment
  | page_size | The page size

## Member Function Documentation

void Gtk::Adjustment::changed | ( |  | ) |

Emits a "changed" signal from the Adjustment.

This is typically called by the owner of the Adjustment after it has changed any of the Adjustment fields other than the value.

void Gtk::Adjustment::clamp_page | ( | double | lower,
|  | double | upper |
| ) |  |  |

Updates the Adjustment value to ensure that the range between the parameters lower and upper is in the current page (i.e. between value and value + page_size ).

If this 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.

Parameters:

  | upper | The upper value.
  | lower | The lower value.

double Gtk::Adjustment::get_lower | ( |  | ) | const

Retrieve the lower member variable.

Returns:
  The current value of lower.

double Gtk::Adjustment::get_page_increment | ( |  | ) | const

Retrieve the page_increment variable.

Returns:
  The current value of page_increment.

double Gtk::Adjustment::get_page_size | ( |  | ) | const

Retrieve the page_size variable.

Returns:
  The current value of page_size.

double Gtk::Adjustment::get_step_increment | ( |  | ) | const

Retrieve the step_increment variable.

Returns:
  The current value of step_increment.

double Gtk::Adjustment::get_upper | ( |  | ) | const

Retrieve the upper member variable.

Returns:
  The current value of upper.

double Gtk::Adjustment::get_value | ( |  | ) | const

Gets the current value of the adjustment.

See set_value().

Returns:
  The current value of the adjustment.

const GtkAdjustment* Gtk::Adjustment::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Object.

GtkAdjustment* Gtk::Adjustment::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Object.

virtual void Gtk::Adjustment::on_changed | ( |  | ) | `[protected, virtual]`

virtual void Gtk::Adjustment::on_value_changed | ( |  | ) | `[protected, virtual]`

void Gtk::Adjustment::set_lower | ( | double | lower | ) |

Sets the lower member variable.

Parameters:

  | lower | The value to set the lower member variable to.

void Gtk::Adjustment::set_page_increment | ( | double | incr | ) |

Sets the page_increment member variable.

Parameters:

  | incr | The value to set the page_increment member variable to.

void Gtk::Adjustment::set_page_size | ( | double | size | ) |

Sets the page_size member variable.

Parameters:

  | size | The value to set the @ page_size member varialbe to.

void Gtk::Adjustment::set_step_increment | ( | double | incr | ) |

Sets the step_increment member variable.

Parameters:

  | incr | The value to set the step_incrememnt member variable to.

void Gtk::Adjustment::set_upper | ( | double | upper | ) |

Sets the upper member variable.

Parameters:

  | upper | The value to set the upper member variable to.

void Gtk::Adjustment::set_value | ( | double | value | ) |

Sets the current value of the Adjustment.

Parameters:

  | value | The new value of the Adjustment.

Glib::SignalProxy0< void > Gtk::Adjustment::signal_changed | ( |  | ) |

Prototype:
  `void on_my_changed()`

Glib::SignalProxy0< void > Gtk::Adjustment::signal_value_changed | ( |  | ) |

Prototype:
  `void on_my_value_changed()`

void Gtk::Adjustment::value_changed | ( |  | ) |

Emits a "value_changed" signal from the Adjustment.

This is typically called by the owner of the Adjustment after it has changed the Adjustment value field.

## Friends And Related Function Documentation

friend class HScrollbar`[friend]`

friend class Range`[friend]`

friend class VScrollbar`[friend]`

Gtk::Adjustment* wrap | ( | GtkAdjustment * | object,
|  | bool | take_copy = `false` |
| ) |  |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  | object | The C instance.
  | take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- adjustment.h