GtkAdjustment Constructor

GtkAdjustment Constructor

GtkAdjustment (double value, double lower, double upper, double step_increment, double page_increment, double page_size);

Not every widget with an underlying adjustment object uses all six of the properties available. Where this occurs, null is not a valid parameter option; all the adjustment parameters take double values, and you will need to set them as 0.0 where they are not needed.

The first parameter, value, is used by every widget with an adjustable part. It represents the current value, and should be set to the value that you want to see displayed on opening. That setting will most often be 0.0 for percentage-based values (e.g. in a GtkProgressBar or in a GtkScrollbar), or 1.0 for literal values (e.g. in a GtkSpinButton).

lower and upper are the next two parameters. These represent the limitations on the changing value; what is the lowest possible value, and what is the highest? Very often, the opening value is at the start of the rising scale, and will in that case be equal in value to the lower parameter setting. The way you choose to express the upper bound may depend on the step_increment, which is defined in the fourth parameter when it is used at all. For instance, you could set the upper bound at 100.0 and increment the value in steps of 1.0, or set it at 1.0 and increment the value in steps of 0.01, depending on what it is you are measuring or on your mood. Either goes the same distance.

The final two parameters are page_increment and page_size. Where these are used, the page_increment should have roughly 90% of the page_size value. If you set the page size to the same value as the upper bound, a GtkScrollbar using these values will be extended so that it cannot be scrolled. This can be a way to test whether your values are being set. In some widgets - GtkCList, GtkLayout, GtkText and GtkViewport - the adjustment values can be set internally by scrolling-aware container widgets, and these will override settings that are made manually. A GtkScrollbar, conversely, has no adjustment values until you set them. Caveat: if a scrollbar shares a GtkAdjustment object with a widget that has overriding pre-set values, the scrollbar will share the widget's adjustment settings as part of the process of becoming associated with that widget.

See also: GtkCList, GtkLayout, GtkProgressBar, GtkRange, GtkScale, GtkScrollbar, GtkScrolledWindow, GtkSpinButton, GtkText, GtkViewport, set_focus_hadjustment() , set_focus_vadjustment() .

© Copyright 2003-2023 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.