Re: [gnome-about] Title box is a hyperlink



On Mon, Jan 03, 2000 at 06:04:18PM -0500, Havoc Pennington wrote:
> I think we should always have _new() for the common cases. Arguments
> require reading more documentation, aren't typesafe, and are less
> convenient if you are doing something really common.

Yes, but in gnome-about's case there is just too much passed in to the new.
I'd keep it as is but I would say that using the args is prefered.  I'm sure
there are others.

I think perhaps for a lot of stuff where the new parameters are more
optional, we'd be better off with a _new() without any arguments and all the
arguments being optional.  There are already a bunch of widgets where you do
a _new and then a bunch of _set_this and _set_that to make it work right.  Or
widgets where you pass the same argument to _new() everywhere, which could
just have been a default.

However I think we should not change any of the _new() calls, we should just
add argument support and encourage their use along with gtk_widget_new in
cases where it makes sense.

> For example:
>  label = gtk_label_new(_("Blah"));
> 
> or:
>  
>  label = gtk_widget_new(gtk_label_get_type(),
>                         "text", _("Blah"), NULL);

Yes, for a label, using args would suck, agreed.

> the second version gets old real fast. 
> 
> Of course in the GnomeAbout case the args seem like a really nice API
> since you have lots of fields and many of them are optional.

Yes.

> We do need to _support_ arguments for all the widgets though.

My fingers are twitching to start adding argument support to some widgets. :)

George



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