2010/7/9 Michael Foord <[email protected]>

>  On 09/07/2010 16:20, Alex wrote:
>
>
>  This is probably the most effective solution. Instead of providing direct
> access to the UI elements provide an API for installing event handlers and
> wrap the user code in exception handling. Another way is to provide proxy
> objects  as you suggest.
>
> It may be a limitation - but if you want the user to be able to have access
> to your UI objects and attach events executing arbitrary code how else are
> you going to handle exceptions? This isn't a limitation of IronPython but a
> limitation of executing arbitrary user code in response to events.
>
>
yep, for the event attachement problem I think that IronPyton could have a
thin metaprogramation layer, when it encouters the  "button.Click += foo"
statement, it decorates foo automatically.
figuratively in the C# client we could have script.Execute(_scope, meta)
that raises the meta.EventAdded event that notify you the user is attaching
an event and let you decorates it. meta could also have some flags to impose
limitations etc..
 I dont know if it conflicts some core IronPython design.  I may try to do
it one day. If it works I'll propose it ;)
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to