Re: gtk_type_foreach?



On Mon, 21 Sep 1998, Johannes Keukelaar wrote:

> //On 15 Sep 1998, Marius Vollmer wrote:
> //
> //> johannes@nada.kth.se (Johannes Keukelaar) writes:
> //> 
> //> > Is there any reason why there is no gtk_type_foreach function?
> //> 
> //> Hmm.  I'm not saying that such a function wouldn't be useful, but you
> //> must be aware that most types are dynamically added to the type
> //> system.  You will only find GtkFileSelection in the type list after at
> //> least one GtkFileSelection widget has been created.  (Types are never
> //> removed from the system, tho.)
> //
> //I could probably find a use for this sort of thing too, but, exactly as
> //Tim Janik describes, it is better implemented with a "hook" function that
> //allows the programmer to get notified when new types are created. 
> 
> That _could_ be enough. But you'd have to define the hook such that, at the 
> time of installation, it will be called for each of the types then registered. 

Yes, I assume this. Indeed, I find this a very elegant approach. 

> (But then, your hook might depend on that it gets called for more basic types 
> before it gets called for their derived types. Interesting problem.)

Hmm, topological sort, I guess. This may happen automatically (just call
the hook on types in order from "earliest" to "latest".) 

-- 
Kenneth Albanowski (kjahds@kjahds.com, CIS: 70705,126)




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