Re: Guile-gnome



>> The problem is that many Gnome widgets use capabilities that can't
>> be expressed in the .defs file.  For instance neither arrays of
>> strings nor GLists can be handled.

Quartic> Would it be possible to have the guile-gnome bindings
Quartic> abstract these things into Scheme lists and vectors?  That
Quartic> would seem to me like a convenient way to handle things.

Yeah, that's a totally reasonable approach.

Basically, support for this requires 2 things:

1. Syntax in gtk.defs, e.g.:

	(define-object GnomeMessagebox (GtkWidget)
	   ((list GtkWidget) buttons)
	   (bool modal))

2. Code in gen-typeinfo to generate code that does appropriate
conversions.  In the above case, that would mean functions to convert
Scheme lists to GLists and back again (with appropriate type checking
on list elements, etc).

I'd probably map both C arrays and GLists onto Scheme lists (but not
using the same syntax in the .defs file, of course).  You don't use
vectors much in Scheme, and if you do you can always run vector->list.

There are many more extensions to gtk.defs that would be useful.  A
proposal for this was presented on the gtk list a while back.  Anybody
interested in hacking in this area should look it up.

One interesting idea was that gtk.defs could be used to generate
bindings for many languages, not just Scheme.  This still seems like a
good plan to me.

Tom



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