Re: default label properties



On 9 Nov 2001, jacob berkman wrote:

> this patch makes GtkLabel actually default to what the properties say it
> should default to.
> 
> i've noticed things like this in the past -

please bug us immediately, or, as you did, send in patches ;)

> it begs for GObject to set
> the defaults itself somehow.

yeah, there's some overlap here that can produce inconsistencies
like you just enountered. however, making gobject loop over all
properties at startup to set defaults, would be *quite* expensive,
and probablöy also unexpected for existing code.

about your patch:

> Index: gtklabel.c
> ===================================================================
> RCS file: /cvs/gnome/gtk+/gtk/gtklabel.c,v
> retrieving revision 1.108
> diff -u -r1.108 gtklabel.c
> --- gtklabel.c  2001/11/08 18:56:23     1.108
> +++ gtklabel.c  2001/11/09 22:05:13
> @@ -580,8 +580,8 @@
> 
>    label->label = NULL;
> 
> -  label->jtype = GTK_JUSTIFY_CENTER;
> -  label->wrap = FALSE;
> +  label->jtype = GTK_JUSTIFY_LEFT;
> +  label->wrap = TRUE;
> 
>    label->use_underline = FALSE;
>    label->use_markup = FALSE;

this is unfortunately the wrong approach, instead, you should change
the default on the params to GTK_JUSTIFY_CENTER and FALSE. the reason
being that we can't simply change defaults in widget creation. old
code does gtk_label_new() and expects it to be centered and not
wrapping. while i agree that wrap=TRUE and maybe GTK_JUSTIFY_LEFT
would have been better defaults in the first place, we can't hose
existing GUIs by shifting defaults they were designed with ;(

---
ciaoTJ




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