Hi,
I'm still stuck with the idea that you are attempting to solve some
problem using the wrong approach.
I don't see the absence of a typeid function as any problem at all.
Creating an event that does not reflect the state of the object that
receives it seems utterly pointless to me.
If a widget does not behave in the way you wish, sub-class it and make
the sub-class behave the way you want it to.
wxPerl fully supports simple usage of the three main event classes
Wx::Event
Wx::CommandEvent
Wx::NotifyEvent
using your own custom event id's and it supports true custom events
using Wx::PlEvent and Wx::PlCommandEvent
From Wx 0.9922 and wxWidgets 2.9.4 you can use the
Wx::UIActionSimulator if you really want to test user interaction with
the GUI.
You can swap entire eventhandler classes using PushEventHandler,
PopEventHandler and family to suit your application state or test mode.
For testing with wxWidgets 2.9.4 you can intercept every event triggered
using Wx::EventFilter or Wx::App->FilterEvent.
What precisely do you want to achieve by mimicking system produced events?
Regards
Mark
On 25/05/2013 20:32, Moshe Aelion wrote:
Dear wxPerl experts
In wxPython, you can find an event type by calling a method (or
property?) "typeId".
See examples below.
It seems that there is no such functionality in wxPerl (maybe since
"EVT_SOMETHING"
in wxPerl encapsulates the call to the event binder, while in wxPython,
"EVT_SOMETHING" is a lower-level subroutine?)
Finding the event type enables you to mimic (or artificially trigger) a
widget command event.
This is sometimes necessary, for testing purposes and other programmatic
purposes.
(It's necessary in order to mimic existing events, not only for custom,
user-defined events).
Is there a way to get the EVT_SOMETHING.typeId functionality in wxPerl?
Many TIA
Helen
--------------------------------
Examples:
1.
> event = wx.CommandEvent(self.EVT_TEXT_CHANGED.typeId, self.Id)
(in: https://svn.ceon.pl/research/SegmEdit/SegmEditGUI/controls.py)
2.
> printevent = wx.PyCommandEvent(EVT_PRINT_MESSAGE.typeId,
ID_PRINT_MESSAGE)
(line 113 in:
http://nullege.com/codes/show/src@p@y@python-irc-h...@pyrc.py/113/wx.PyCommandEvent)
3.
> if evt and (renewOverlay or evt.GetEventType() == wx.EVT_SIZE.typeId):
(line 150 in:
www.seismic-handler.org/browser/SHX/trunk/sandbox/traceplotter.py?rev=414
<http://www.seismic-handler.org/browser/SHX/trunk/sandbox/traceplotter.py?rev=414>)
and many others.