Re: alignment scales



On 11 Sep 2001, Havoc Pennington wrote:

> Hi,
> 
>    Mon Sep 10 16:55:49 2001  Tim Janik  <timj gtk org>
> 
>         * gtk/gtkalignment.c (gtk_alignment_init): fix xscale and
>           yscale behaviour which havoc broke. they have to default to
>           1.0 for expand behaviour.
> 
> While admittedly I shouldn't have checked that in (the param spec and
> _init function were out-of-sync, so I thought it was just a small
> bugfix), I think 1.0 is a bad default - an alignment with 1.0
> xscale/yscale has no effect whatsoever - it is a complete no-op
> container (with the exception of border width). The xalign/yalign
> params have no effect in this case.  Or am I missing something?

nope, correct so far.

> So what do you mean "have to default to 1.0 for expand behavior"?
> When would I want this? All widgets have expand behavior naturally,
> they don't need assistance from an alignment. The only reason to use
> an alignment is to suppress expand behavior in at least one dimension
> (horizontal or vertical).

it's also very convenient to derive from if you're not sure how to
pack things inside your new container, (i.e. you just pack another
h/v box into it, instead of having to change derivation if you're
about to pack things differently).

> Changing the default breaks things for gtk_widget_new users. Since
> Beast, GLE, etc. are the only apps in CVS that use gtk_widget_new to
> create alignments, a survey of its usage:

[...skipping survey]

> So:
> 
>  - changing the default only breaks cases E and maybe C
> 
>  - fixing the default would assist everyone using Glade, since 
>    alignments will be set up for the common case by default

i'd agree that 0.0 is the better default to have here. however,
changing defaults breaks GUIs in subtle ways and hard to track down
ways.
it took me quite some time (even using GLE) to figure why my widget
layouts were suddenly broken after updating to your new gtk version.
changing defaults also breaks GUI builders that are clever enough to
not save parameters which the user left/switched back to their
defaults.
if i hadn't to worry about breaking existing GUIs, i'd immediately
change defaults:
1) for widgets to be shown automatically at startup
2) for gtk_box_pack_*() to _not_ expand by default
3) alignments to scale to 0.0 by default
in that order.

> 
> Havoc
> 

---
ciaoTJ





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