Lukáš Duběda wrote:
> Thanks for pointing that out, Curt,
>
> now, for such a trivial function I can imagine substituting
> it with a Lambda, however, how would I use a more complex
> function?
>
> I found out exactly that when not passing any arguments
> the function works like this:
>
> def functName(self, sender):
> ....
> pass
>
> (XamlDef.FindName('btnCreate')).Click += functName
>
>
> This has worked flawlessly, as soon as I need to pass it
> an argument. I haven't found a way to do that.
You can always just create a closure:
def outer_lambda(...):
foo = 42
def functName(self, sender):
print foo
(XamlDef.FindName('btnCreate')).Click += functName
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com