Guile Mailing List Archive

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

Re: Is it OK to pass an SCM through (void *)?




rlb@cs.utexas.edu writes:
> Maciej Stachowiak <mstachow@mit.edu> writes:
> 
> > I noticed that you were trying to provide some interfaces for the user
> > to connect Scheme code to GUI elements. Why don't you just use
> > guile-gtk for this purpose, since it deals with all the GC issues? I
> > think it should be safe to embed it in gtk-based C apps with no extra
> > worries (someone correct me if I'm wrong).
> 
> Well, the app was already written in C, and we're using SWIG to
> provide bindings to the engine.  It's supposed to be a GNOME app, so
> guile-gtk might not be the right thing.  I looked into gnome-guile,
> but from what I could tell, it seems like it might be a little
> immature.  Initially, I was just embedding guile in GnuCash to handle
> some dynamic aspects.  Switching to gnome-guile would be a more
> wholesale change, putting guile in primary control of everything.
> While I'm perfectly happy with that, and would be perfectly happy to
> see GnuCash be a Guile app with a C transaction and UI engine, and
> while I have been migrating things in that direction anyway, I'm not
> sure everyone else is ready for that kind of wholesale adoption...

No, what I was suggesting is not rewriting the app so that Guile is in
control of everything - what I was suggesting is that you can have an
app that creates gnome and/or gtk widgets, and has an embedded Guile
interpreter, and link guile-gtk (and maybe also gnome-guile) and mix
the widgets created from C with ones created from Scheme. Thus, C
would still be the master world, but you could create arbitrary GUI
add-ons from the configuration/extension language.

This is, admittedly, still a fairly radical goal (although the user
could probably do it anyway with (use-modules (gtk gtk)) ), but it may
also be useful to look at what guile-gtk does to bind Guile procedures
to Gtk signals and copy that.

 - Maciej





Guile Home | Main Index | Thread Index