This is the mail archive of the
guile-gtk@sources.redhat.com
mailing list for the Guile project.
Re: Newbie pleading for help...
- From: Brett Viren <bv at bnl dot gov>
- To: Alex Kim <theseven222 at yahoo dot com>
- Cc: Bo Forslund <bo dot forslund at abc dot se>, guile-gtk at sources dot redhat dot com, guile-user at gnu dot org
- Date: Wed, 20 Feb 2002 12:48:55 -0500
- Subject: Re: Newbie pleading for help...
- References: <3C73B6EF.D482F76C@abc.se><20020220172011.35235.qmail@web20407.mail.yahoo.com>
- Reply-to: Brett Viren <bv at bnl dot gov>
Alex Kim writes:
> Then, I wanted to add event processing loop for the
> GUI itself to respond to the mouse interaction so
> that I can interactively modify the lines as needed.
Consider doing everything in guile-gnome using the Gnome Canvas widget
for the drawings. You'll be hard pressed to find a better way to draw
and manipulate graphical objects.
See
http://superk.physics.sunysb.edu/~bviren/play/gtkin/gtkin.scm
for *partial* inspiration. I wrote this a long time ago but it still
runs with libguilegtk/libguilegnome v0.20 (which is the latest on my
Debian system).
This little toy doesn't have any interaction between the canvas
objects and the mouse pointer like you want, but it does show how to
use the gnome canvas with guile and how to manipulate the graphical
objects with some sliders.
But, going further, canvas objects can receive events just like
regular widgets. (At least this is true in the underlying C canvas,
never tried with the guile bindings.) By attaching to these events,
you can add the interactivity you want. How to do that is left as an
exercise to the reader ('cause I don't know).
-Brett.