Re: update label patch, and gtktoolbar patch



On Tue, 2001-11-13 at 20:44, Owen Taylor wrote:
> 
> jacob berkman <jacob ximian com> writes:
> 
> > On Fri, 2001-11-09 at 17:54, Owen Taylor wrote:
> > > 
> > > jacob berkman <jacob ximian com> writes:
> > > 
> > > > this patch makes GtkLabel actually default to what the properties say it
> > > > should default to.
> > > > 
> > > > i've noticed things like this in the past - it begs for GObject to set
> > > > the defaults itself somehow.
> > > 
> > > You need to fix what the property reports, not change the defaults.
> > 
> > ok, here's a fixed gtklabel patch, and is this gtktoolbar patch ok?
> 
> The label patch looks fine, _but_ Matt Wilson pointed out to
> me today that although the default in GTK+-1.2 was CENTER for
> justification, it turned out that CENTER only half worked -
> it worked for explicit newlines in non-autowrapped labels, but not 
> for auto-wrapped labels.

ok, new patch for this.

> The tooltips patch looks basically OK (though I don't know why you'd
> want to disable tooltips, especially programmatically...), with two
> comments:

yeah seems like a bad idea.  i'll just mark the property as obsolete in
libglade-convert.

> >    if (enable)
> >      gtk_tooltips_enable (toolbar->tooltips);
> >    else
> >      gtk_tooltips_disable (toolbar->tooltips);
> > +
> > +  g_object_notify (G_OBJECT (toolbar), "tooltips");
> >  }
> 
> Also, noticed a bug in the existing code while looking at your
> patch. gtk_tooltips_destroy() frees toolbar->tooltips, but
> other parts of the widget assume that toolbar->tooltips 
> exists unconditioanlly. There are basically two possibilities
> here:
> 
>  1) Lazily create toolbar->tooltips with a 
>     static GtkTooltips *gtk_widget_get_tooltips() so that
>     if they are destroyed, we recreate them.
> 
>  2) Destroy the tooltips in finalize(), not destroy().
> 
> The choise here basically depends on whether toolbar->tooltips is
> considered private or not. If it is publically accessible, then we
> need to destroy it in destroy(), otherwise we can wait for finalize().
> 
> I think on balance I prefer 1), though either would be basically
> OK.

i can still fix this if you want; it'll just take a few more days until
i get to it.

jacob
-- 
"Beat mixing is 10000 times more fun than even video games."
	-- bt
Index: gtklabel.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtklabel.c,v
retrieving revision 1.110
diff -u -r1.110 gtklabel.c
--- gtklabel.c	2001/11/14 23:10:53	1.110
+++ gtklabel.c	2001/11/15 22:13:50
@@ -326,7 +326,7 @@
                                    g_param_spec_boolean ("wrap",
                                                         _("Line wrap"),
                                                         _("If set, wrap lines if the text becomes too wide."),
-                                                        TRUE,
+                                                        FALSE,
                                                         G_PARAM_READWRITE));
   g_object_class_install_property (gobject_class,
                                    PROP_SELECTABLE,
@@ -578,7 +578,7 @@
   
   label->label = NULL;
 
-  label->jtype = GTK_JUSTIFY_CENTER;
+  label->jtype = GTK_JUSTIFY_LEFT;
   label->wrap = FALSE;
 
   label->use_underline = FALSE;


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