Re: [gtk-list] Re: an additional argument flag



Owen Taylor <owt1@cornell.edu> writes:

> Take a look at GtkInputDialog. All initialization is done in the
> _init() function, and I don't see why that should be moved.

You're correct, the problem with InputDialog is quite different (it's
been a while since I've looked at it, and I mixed things up in my
mind). Actually, I'm not sure there is a problem anymore. Oh well.

> But be that as it may, it seems to me that everybody isn't
> quite talking about the same thing here.

Indeed. We had a problem when writing the gtk-- binding for GtkCList
(there was simply too much code to duplicate), and the simplest way to
solve it was to ask Jay to provide us with the _construct() thing. Tim
stepped in from there and took the idea further.

> The problem is quite clear:
> 
>  Some widgets need to do initialization that _depends_ on 
>  the parameters that are passed in. However, no parameters
>  are passed to the _init() function. So this has to be
>  done in the new () function. (The list of such functions
>  is currently quite short though)

This is correct. What we have is "constructors" (in the "sort-of
C++-ish" meaning of the term) that can't be called by derived classes
(the _new() functions). Therefore the proposition to have
_constructor(widget*)s that would be passed the widget to build,
instead of internally calling gtk_type_new().

-- 
					Guillaume.
					http://www.worldnet.fr/~glaurent



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