raffaello provided the answer here via personal email (thanks). in case
anyone else googles this, my code that works is:
def click(self):
cmd = wx.CommandEvent(wx.EVT_BUTTON.evtType[0])
cmd.SetEventObject(self.ok)
cmd.SetId(self.ok.GetId())
self.ok.GetEventHandler().ProcessEvent(cmd)
where this is a method defined on the Dialog subclass and "ok" is the
Button with id wx.ID_OK (although that particular id only matters in my
case because i am looking at Validators).
andrew
···
Hi,
I have a Dialog which contains some TextCtrls, with Validators, and an OK
Button. When I display the Dialog modally and click on "OK" the
validators are called.However, if I display the Dialog using Show() and then programatically
called
ok.ProcessEvent(wx.MouseEvent(wx.wxEVT_LEFT_DOWN))
ok.ProcessEvent(wx.MouseEvent(wx.wxEVT_LEFT_UP))
(where ok is the Button) the Validators are not called (more exactly, the
TransferToWindow methods are called on Dialog.Show(), but the Validate and
TransferFromWindow methods are not called on the mouse events).I guess that I am not raising the event expected. What should I be doing
instead?Thanks,
Andrew_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users