[IronPython] Foolproof IP Embedding

Alex alex at glumol.com
Fri Jul 9 20:33:35 CEST 2010


2010/7/9 Michael Foord <fuzzyman at voidspace.org.uk>

>  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 ;)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100709/592ac690/attachment.html>


More information about the Ironpython-users mailing list