Re: guile-gtk?



Miroslav Silovic <silovic@zesoi.fer.hr> writes:

> Daniel Barlow <dan@telent.net> writes:
> 
> > Are there speed considerations which would bias it either way?  If I'm
> > looking at pointer motion events, for example, I'm probably getting
> > quite a lot of them, and I probably want to get at least x, y and
> > button status information: are three calls into C code more or less
> > expensive than one to build an alist and then call assoc a lot?
> 
> One consideration is consing the alist. It will be pretty long (look
> at the x event structure sizes) and there will be a lot of them.
> This means gcfest. Accessors don't have this problem.

True.  Aditionally, the problem of there being many accessor functions 
can be solved by using more generic functions like:

    (gdk-event-property EVENT PROPERTY)

and:

    (set-gdk-event-property EVENT PROPERTY VALUE)

This is only two functions that provide basically all the needed
functionality.  For ease of use, one might create something like:

    (gdk-event-properties EVENT)

to return a plist of relevant properties and:

    (set-gdk-event-properties EVENT PLIST)

...to set multiple properties of EVENT.

Note, though, that I am not proficient in Scheme (I usually hack
Lisp), so don't be surprised if I have just mouthed a string of
blasphemous heresies.

-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
Unspeakable horrors from outer space paralyze the living and
resurrect the dead!



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