Here's an example (Suse SLES10, wxpython 2.8.12.1, and python 2.7.2).
We use ProcessEvent to create a mock event in testing but then we
cannot intercept the object associated.
The screen output reads.
Event ojbect: None
Event ojbect: <wx._controls.CheckBox; proxy of <Swig Object of type
'wxCheckBox *' at 0xad2490> >
Event ojbect: <wx._controls.CheckBox; proxy of <Swig Object of type
'wxCheckBox *' at 0xad2490> >
Here’s an example (Suse SLES10, wxpython 2.8.12.1, and python 2.7.2).
We use ProcessEvent to create a mock event in testing but then we
cannot intercept the object associated.
Here’s an example (Suse SLES10, wxpython 2.8.12.1, and python 2.7.2).
We use ProcessEvent to create a mock event in testing but then we
cannot intercept the object associated.
Thanks a lot for the solution.
However, I don't understand why you need to set the event object even
though you provided the id of the object to ProcessEvent.
I suppose there's really no answer other than "because you do". I've
been trying to come up with a circumstance where the event object might
be different from the one in the constructor, but I have failed. One
might invoke the old Python rule "explicit is better than implicit", but
in this case the design comes from the C++ wxWidgets library.
···
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
In EVT_MENU events the ID is the menu item's ID but the event object is something else depending on where the event came from.
···
On 7/3/12 2:52 PM, Tim Roberts wrote:
JR wrote:
Thanks a lot for the solution.
However, I don't understand why you need to set the event object even
though you provided the id of the object to ProcessEvent.
I suppose there's really no answer other than "because you do". I've
been trying to come up with a circumstance where the event object might
be different from the one in the constructor, but I have failed. One
might invoke the old Python rule "explicit is better than implicit", but
in this case the design comes from the C++ wxWidgets library.