I am trying to define my own events. In this context, I have several
questions:
- How do I find a guaranteed unique event-ID for my new event?
- I need to pass python objects trough the event system. Is this
possible?
- I would like to define my own event class derived from
wxCommandEvent. I tried this, but (as I expected), after the Event
has travelled to it's destination, the class has been chopped --
it's only a wxCommandEvent not a MyEvent anymore Is there any
way to use user-defined python event classes? (If I need a few
lines of C++ code, that would be OK, but I'd prefer a python-only
solution)
I am trying to define my own events. In this context, I have several
questions:
- How do I find a guaranteed unique event-ID for my new event?
wxNewEventType()
- I need to pass python objects trough the event system. Is this
possible?
See below.
- I would like to define my own event class derived from
wxCommandEvent. I tried this, but (as I expected), after the Event
has travelled to it's destination, the class has been chopped --
it's only a wxCommandEvent not a MyEvent anymore Is there any
way to use user-defined python event classes? (If I need a few
lines of C++ code, that would be OK, but I'd prefer a python-only
solution)
Derive your event class from wxPyCommandEvent. There is an example of doing
this in demo/PythonEvents.py.