Re: [gtk-list] Re: A type system for high-level interfaces



Marius Vollmer <mvo@zagadka.ping.de> writes:

> To explain, what I have in mind for enumerations: You could write this
> code to create a toplevel window
> 
>     (gtk-window-new 'toplevel)
> 
> The 'toplevel argument is essentially a string that has to be strcmped
> against all the literals of the GtkWindowType enumeration, at
> run-time.  The stub for gtk-window-new knows that the argument is a
> GtkWindowType enumeration and calls a Gtk function to obtain its type
> id, much like gtk_object_get_type can be used to get the type id of
> GtkObjects.  From that type id, all necessary information about the
> enumeration can be obtained.

Don't know much about what you're trying to do, but why not making
toplevel a scheme symbol whose value is the integer corresponding to
the C enumeration tag?
Making those symbols part of a gtk module (or prefixed by gtk:) would
help alleviating the name pollution problem.
-mav



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