alignment scales


   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?

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).

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:

case A:
 xscale/yscale is irrelevant to behavior since alignment is empty:

case B:
 xscale/yscale explicitly set to 0.0:

case C:
 base class for new widget, no idea of the details:

case D:
 xscale/yscale explicitly set to 1.0, but xalign/yalign also set, 
 which doesn't make much sense, and means the alignment has 
 no effect:
case E:
 xscale/yscale/xalign/yalign left as defaults, meaning the alignment 
 has no effect:


 - 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


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