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

George <> writes:

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

Supporting arguments is good, but they should always be optional - there should
be direct accessors for the same attributes. (And as a corollary to that
and a good idea for other reasons, you should try to always avoid constructor
arguments - a widget should be default-constructable, and all arguments
should be able to be set after creation.)


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