Adjustment

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.

Constructors

this
this(GtkAdjustment* gtkAdjustment)

Sets our main struct and passes it to the parent class

this
this(double value, double lower, double upper, double stepIncrement, double pageIncrement, double pageSize)

Creates a new GtkAdjustment.

Members

Functions

addOnChanged
void addOnChanged(void delegate(Adjustment) dlg, ConnectFlags connectFlags)

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

addOnValueChanged
void addOnValueChanged(void delegate(Adjustment) dlg, ConnectFlags connectFlags)

Emitted when the GtkAdjustment value field has been changed.

changed
void changed()

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.

clampPage
void clampPage(double lower, double 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.

configure
void configure(double value, double lower, double upper, double stepIncrement, double pageIncrement, double pageSize)

Sets all properties of the adjustment at once. Use this function to avoid multiple emissions of the "changed" signal. See gtk_adjustment_set_lower() for an alternative way of compressing multiple emissions of "changed" into one. Since 2.14

getAdjustmentStruct
GtkAdjustment* getAdjustmentStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getLower
double getLower()

Retrieves the minimum value of the adjustment. Since 2.14

getPageIncrement
double getPageIncrement()

Retrieves the page increment of the adjustment. Since 2.14

getPageSize
double getPageSize()

Retrieves the page size of the adjustment. Since 2.14

getStepIncrement
double getStepIncrement()

Retrieves the step increment of the adjustment. Since 2.14

getStruct
void* getStruct()

the main Gtk struct as a void*

getUpper
double getUpper()

Retrieves the maximum value of the adjustment. Since 2.14

getValue
double getValue()

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

setLower
void setLower(double lower)

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 g_object_freeze_notify() and g_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 gtk_adjustment_configure() has the same effect of compressing "changed" emissions. Since 2.14

setPageIncrement
void setPageIncrement(double pageIncrement)

Sets the page increment of the adjustment. See gtk_adjustment_set_lower() about how to compress multiple emissions of the "changed" signal when setting multiple adjustment properties. Since 2.14

setPageSize
void setPageSize(double pageSize)

Sets the page size of the adjustment. See gtk_adjustment_set_lower() about how to compress multiple emissions of the "changed" signal when setting multiple adjustment properties. Since 2.14

setStepIncrement
void setStepIncrement(double stepIncrement)

Sets the step increment of the adjustment. See gtk_adjustment_set_lower() about how to compress multiple emissions of the "changed" signal when setting multiple adjustment properties. Since 2.14

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
setUpper
void setUpper(double upper)

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_set_lower() about how to compress multiple emissions of the "changed" signal when setting multiple adjustment properties. Since 2.14

setValue
void setValue(double value)

Sets the GtkAdjustment value. The value is clamped to lie between adjustment->lower and adjustment->upper. Note that for adjustments which are used in a GtkScrollbar, the effective range of allowed values goes from adjustment->lower to adjustment->upper - adjustment->page_size.

valueChanged
void valueChanged()

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.

Static functions

callBackChanged
void callBackChanged(GtkAdjustment* adjustmentStruct, Adjustment _adjustment)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackValueChanged
void callBackValueChanged(GtkAdjustment* adjustmentStruct, Adjustment _adjustment)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

connectedSignals
int[string] connectedSignals;
gtkAdjustment
GtkAdjustment* gtkAdjustment;

the main Gtk struct

onChangedListeners
void delegate(Adjustment)[] onChangedListeners;
Undocumented in source.
onValueChangedListeners
void delegate(Adjustment)[] onValueChangedListeners;
Undocumented in source.

Inherited Members

From ObjectGtk

gtkObject
GtkObject* gtkObject;

the main Gtk struct

getObjectGtkStruct
GtkObject* getObjectGtkStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
getId
string getId(StockID id)
connectedSignals
int[string] connectedSignals;
onDestroyListeners
void delegate(ObjectGtk)[] onDestroyListeners;
Undocumented in source.
addOnDestroy
void addOnDestroy(void delegate(ObjectGtk) dlg, ConnectFlags connectFlags)

Signals that all holders of a reference to the GtkObject should release the reference that they hold. May result in finalization of the object if all references are released. See Also GObject

callBackDestroy
void callBackDestroy(GtkObject* objectStruct, ObjectGtk _objectGtk)
Undocumented in source. Be warned that the author may not have intended to support it.
sink
void sink()

Warning gtk_object_sink has been deprecated since version 2.10 and should not be used in newly-written code. Use g_object_ref_sink() instead Removes the floating reference from a GtkObject, if it exists; otherwise does nothing. See the GtkObject overview documentation at the top of the page.

weakref
void weakref(GDestroyNotify notify, void* data)

Warning gtk_object_weakref is deprecated and should not be used in newly-written code. Use g_object_weak_ref() instead. Adds a weak reference callback to an object. Weak references are used for notification when an object is finalized. They are called "weak references" because they allow you to safely hold a pointer to an object without calling g_object_ref() (g_object_ref() adds a strong reference, that is, forces the object to stay alive).

weakunref
void weakunref(GDestroyNotify notify, void* data)

Warning gtk_object_weakunref is deprecated and should not be used in newly-written code. Use g_object_weak_unref() instead. Removes a weak reference callback to an object.

destroy
void destroy()

Warning gtk_object_destroy has been deprecated since version 2.24 and should not be used in newly-written code. Use gtk_widget_destroy() instead (if object is a widget) Emits the "destroy" signal notifying all reference holders that they should release the GtkObject. See the overview documentation at the top of the page for more details. The memory for the object itself won't be deleted until its reference count actually drops to 0; gtk_object_destroy() merely asks reference holders to release their references, it does not free the object.

removeNoNotify
void removeNoNotify(string key)

Warning gtk_object_remove_no_notify is deprecated and should not be used in newly-written code. Use g_object_steal_data() instead. Remove a specified datum from the object's data associations (the object_data), without invoking the association's destroy handler. Just like gtk_object_remove_data() except that any destroy handler will be ignored. Therefore this only affects data set using gtk_object_set_data_full().

setUserData
void setUserData(void* data)

Warning gtk_object_set_user_data is deprecated and should not be used in newly-written code. Use g_object_set_data() instead. For convenience, every object offers a generic user data pointer. This function sets it.

getUserData
void* getUserData()

Warning gtk_object_get_user_data is deprecated and should not be used in newly-written code. Use g_object_get_data() instead. Get the object's user data pointer. This is intended to be a pointer for your convenience in writing applications.

addArgType
void addArgType(string argName, GType argType, uint argFlags, uint argId)

Warning gtk_object_add_arg_type is deprecated and should not be used in newly-written code. Deprecated in favor of the GObject property system including GParamSpec. Add a new type of argument to an object class. Usually this is called when registering a new type of object.

setDataById
void setDataById(GQuark dataId, void* data)

Warning gtk_object_set_data_by_id is deprecated and should not be used in newly-written code. Use g_object_set_qdata() instead. Just like gtk_object_set_data() except that it takes a GQuark instead of a string, so it is slightly faster. Use gtk_object_data_try_key() and gtk_object_data_force_id() to get an id from a string.

setDataByIdFull
void setDataByIdFull(GQuark dataId, void* data, GDestroyNotify destroy)

Warning gtk_object_set_data_by_id_full is deprecated and should not be used in newly-written code. Use g_object_set_qdata_full() instead. Just like gtk_object_set_data_full() except that it takes a GQuark instead of a string, so it is slightly faster. Use gtk_object_data_try_key() and gtk_object_data_force_id() to get an id from a string.

getDataById
void* getDataById(GQuark dataId)

Warning gtk_object_get_data_by_id is deprecated and should not be used in newly-written code. Use g_object_get_qdata() instead. Just like gtk_object_get_data() except that it takes a GQuark instead of a string, so it is slightly faster. Use gtk_object_data_try_key() and gtk_object_data_force_id() to get an id from a string.

removeDataById
void removeDataById(GQuark dataId)

Warning gtk_object_remove_data_by_id is deprecated and should not be used in newly-written code. Use g_object_set_qdata() with data of NULL instead. Just like gtk_object_remove_data() except that it takes a GQuark instead of a string, so it is slightly faster. Remove a specified datum from the object's data associations. Subsequent calls to gtk_object_get_data() will return NULL. Use gtk_object_data_try_key() and gtk_object_data_force_id() to get an id from a string.

removeNoNotifyById
void removeNoNotifyById(GQuark keyId)

Warning gtk_object_remove_no_notify_by_id is deprecated and should not be used in newly-written code. Use g_object_steal_qdata() instead. Just like gtk_object_remove_no_notify() except that it takes a GQuark instead of a string, so it is slightly faster. Use gtk_object_data_try_key() and gtk_object_data_force_id() to get an id from a string.

Meta