Thinking about adjustments



We have various open bugs about when you can set adjustments, the
effects of setting them, and so forth:

On the 2.2.2 milestone:

 http://bugzilla.gnome.org/show_bug.cgi?id=101135
 http://bugzilla.gnome.org/show_bug.cgi?id=110737

And the coelacanth of GTK+ bugs:
 
 http://bugzilla.gnome.org/show_bug.cgi?id=1165

This mail is an attempt to establish some rules for how adjustments are
supposed to work:

* Adjustments should always be construct only properties or appear as
such. [1]

* If you replace the adjustment of a range widget with a new one,
all properties of the new adjustment are preserved and applied to the
range widget.

* If you replace an adjustment of a scrollable widget (such as a 
gtkviewport), then all properties of the adjustment other than the value
are replaced with those applicable to the viewport. The effect is (other
than the new object) equivalent to:

gtk_adjustment_set_value (range->hadjustment, new_hadjustment->value);

* If you replace an adjustment of an scrolled window then all properties
of the adjustment other than the value are replaced with those
applicable to the scrolled window.

* Setting an adjustment of  a range, a scrollable widget, or
a scrolled window to NULL replaces the current adjustment with a newly
created one with identical values to the current adjustment.

* Directly setting the adjustments of a widget that is already within
a scrolled window is illegal.

[1] That is, the widget always appears to have an adjustment set; for
widgets that have "public" [hv]adjusment fields, that means creating
the adjustments at construct time. Widgets that keep the fields private
could do it lazily.

Regards,
					Owen






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]