[IronPython] Events on Buttons, and Focus, in IronPython
drken567 at gmail.com
Mon Feb 22 22:32:16 CET 2010
On Mon, Feb 22, 2010 at 4:12 PM, Curt Hagenlocher <curt at hagenlocher.org>wrote:
> You want args.Key instead of e.Key. The standard event signature is
> function(object sender, EventArgs args)
Tried that, but got runtime error saying that it was being called w/3
arguments, and only two were specified. Adding "self" as first argument
> But the better way to do this is to set the OK button to be the default
> button. In Winforms, this is a property on the form:
> form.AcceptButton = self.ok_button.
tried this approach as well (self is the login dialog):
ok_button == self.control("btnOk") // xaml name for it
ok_button.Click = self.on_ok
self.AcceptButton = ok_button
but no event seemed to be triggered on it. Anyway, the on_enter handler
works once I sorted out the arguments properly.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Ironpython-users