Re: Change viewport size requisition?




Lars Hamann <lars@gtk.org> writes:

> Hi Owen!
> 
> On Sat, Nov 28, 1998 at 06:56:45PM -0500, Owen Taylor wrote:
> 
> > I'm about to commit the patch gtk-rao-981125, which
> > adds the long-requested feature of GTK_POLICY_NEVER
> > to the scrolled window. But I notice that it really
> > isn't as useful as it should be because of an
> > odditity in the way the Viewport widget works.
> [...]
> > I don't see any other way to enable users to get
> > the IMO, very useful above "snapping" behavior
> > without gross hacks.
> 
> The problem is the same for every "scrollable" widget
> which can be added to a scrolled_window. E.g. CList only
> returns the border size too, as long as CLists
> scroll_adjustments are != NULL. If you call
> gtk_clist_set_hadjustment(clist, NULL) clist will
> answer size requests with its exact width.
> I like that behavior, because it works without
> scrolled_windows and its policies. If you don't want
> to scroll a CList in one direction, don't add an adjustment.
> So a GTK_POLICY_NEVER would be very straight forward :
> gtk_widget_scroll_adjustments (widget, NULL, NULL);

The problem with this is that setting an adjustment of a scrollable
widget to NULL has a _different_ meaning that has existed for a long
time for at least the Viewport and Text widgets, which
is "create adjustments for yourself". If we were to follow
your suggestion, that meaning would have to be changed,
which certainly would most likely would break backwards
compatibility in a few places.

(I don't think we should have the meaning of NULL for an 
 adjustment depend on whether it was set via signal or via 
 direct function call)

                                        Owen

[ 

Hmmm, two major problems with 

 gtk_widget_scroll_adjustements

 a) It is mispelled
 b) It (according to the standards we just enforced everywhere else) should 
    be set_scroll_adjustments. The signal is also misnamed...

]




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