Re: GtkBuildable type resolver



On Mon, 2007-06-04 at 16:04 -0300, Johan Dahlin wrote:
> One of the problems pointed out by Matthias in the GtkBuilder bug[1] is how
> a third-party library can define a type name mapping to get type function.
> 
> First, let me try explain a bit more about the problem;
> 
> The types inside a GtkBuilder ui definition files (eg, .glade) are currently
> only referred by their name. This creates a problem since the type names
> are not known until the first time you call the get_type function.
> The long term solution to list problem is to export meta data inside the
> gobject-introspection framework which will contain a list of all
> types and their respective *_get_type function.
[...]
> Does anyone have any other suggestions on how to solve the
> problem, or comments on my solution?

Hi,
   I like the idea of allowing the get_type function to be
defined in the xml/glade file itself, at least that way we
dont need all types to be registered at gtk_init() time
(which seemed to be a bit more sloppy of an approach).
As an aside - we recently did the same excersize in glade,
i.e. if the catalog specifies a type by its registration
function, then the actual type name is introspected from
the type system - otherwize we fall back on the hack
that derives the "foo_bar_get_type" string from "FooBar".

One thing that might or might not be a can of worms is
language bindings. I wonder if someone more experienced
than myself in this realm could point out how we plan
to load widgets written in other languages from the GtkBuilder
perspective, namely how will we obtain the runtime GType of
the object from its name in the xml/glade file.

Cheers,
                     -Tristan





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