Re: guile-gtk?



Daniel Barlow <dan@telent.net> writes:

> 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?

You can't.  Guile-gtk currently does not support much of Gdk.

How would you like to access this information.  There are at least two
general possibilities, and I'm not sure which one to provide.

- A ton of accessor function, so that you can do

    (case (gdk-event-type ev)
      ((motion-notify)
       (pk 'x (gdk-event-x ev) 'y (gdk-event-y ev))))

- Or a single conversion function that turns a GdkEvent into a
  association list

    (pk 'ev (gdk-event->alist ev))
    => ((type . motion-notify) (x . 12.0) (y . 13.0) ...)

Probably best to implement both.



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