lots of callback functions

horace <[email protected]> Fri, 29 May 2009 15:28:16 +0200
Newsgroups gmane.comp.python.pyrex
Message-ID <[email protected]>
hi,

i have figured out how to wrap callback functions but i have a special case
which is a bit cumbersome.

i have to wrap a struct which contains events for every key on the keyboard:

cdef extern from "engine.h":
    ctypedef struct ENGINE_VARIABLES:
        EVENT *on_esc
        EVENT *on_f1
        EVENT *on_f2
        EVENT *on_f3
        # ... events for the rest of the keyboard

of course i could write a predefined cdef callback for each single event,
add a variable for storing the user definable python callback (which gets
called from the cdef callback) for each single event and so on.

but maybe someone has an idea how this could be done more elegantly without
so much writing?

_______________________________________________
Pyrex mailing list
[email protected]
http://lists.copyleft.no/mailman/listinfo/pyrex