[wxPython] How do I define an event and trigger it?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[wxPython] How do I define an event and trigger it?

Ionel Simionescu

Hi,

1.
I want to define some events to be used for the communication between a
document and its associated views.

How do I do that?
(I was unable insofar to find it from the docs.)

2.
Is it the document/view framework implemented in wxPython?

I guess that it is not (yet) done, but I still ask; maybe I'll also learn
why not or when yes.


Thank you,
ionel




_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] How do I define an event and trigger it?

Robin Dunn
> 1.
> I want to define some events to be used for the communication between a
> document and its associated views.
>
> How do I do that?
> (I was unable insofar to find it from the docs.)
>

Create an instance of wxPyEvent or wxPyCommandEvent, set whatever info you
want to send with the event using SetPyData, and then call something like:

    myWin.GetEventHandler().ProcessEvent(myEvent)



> 2.
> Is it the document/view framework implemented in wxPython?
>
> I guess that it is not (yet) done, but I still ask; maybe I'll also learn
> why not or when yes.
>

Not yet, but it is planned.

--
Robin Dunn
Software Craftsman
[hidden email]
http://AllDunn.com/robin/
http://AllDunn.com/wxPython/  Check it out!





_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users