Re: guile-gtk?



On Tue, Feb 03, 1998 at 10:55:33AM -0800, Jim Pick wrote:
> 
> Martin Alonso Soto Jacome <masoto@uniandes.edu.co> writes:
> > By the way, is there documentation available for guile-gtk?  If not, what would be the best way to learn it?
> 
> Take a look at calc.scm, network-utilies, find-file, notepad, test-gtk.scm,
> etc.
> 
> Combine that with the Gtk Tutorial, the Gtk docs, and sample code from any
> other app that uses Gtk, and you've got a lot to go on.

A quick question which I don't see covered in any of the above: can
anyone tell me how to look at the fields inside an event?  I got as far as

    (gtk-widget-set-events canvas '(exposure-mask pointer-motion-mask))
    (gtk-signal-connect canvas "motion_notify_event" 
			(lambda (foo) ( display "do something\n") ))

which successfully does what it looks like it does, but is limited in
its ability to tell me where the event happened.  The printed
representation of foo is `#<GdkEvent 80a4ee0>' for varying values of
80a4ee0, so I assume there's some way of getting things like x and y
co-ordinates out of it.  There seems little point in having it passed
to me otherwise.

Am I glad I'm using Scheme?  Yes, I suspect I probably am.  By ripping
bits of code out of other people's programs with little understanding
of how it works, it only took a couple of hours to get to the point of
needing to know this.

-dan



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