[IronPython] Attaching Silverlight/Gestalt events using IronPython 2.6.1

Jimmy Schementi jimmy at schementi.com
Wed Jul 7 01:31:33 CEST 2010


On Mon, Jul 5, 2010 at 1:58 PM, Jeff Hardy <jdhardy at gmail.com> wrote:

> I'm working on a test Silverlight app using Gestalt and IronPython
> 2.6.1. I've got a local copy of gestalt-20100305 with the assemblies
> in the IronPython.slvx & Microsoft.Scripting.slvx file replaced with
> the ones from IronPython 2.6.1.
>
> When trying to attach an event using
>
>    document.hello.events.onclick += hello_onclick
>
> I get a "AttributeError: 'NoneType' object has no attribute 'onclick'"
> error, because 'events' is None. Using
>
>    document.hello.AttachEvent('onclick',
> System.EventHandler[HtmlEventArgs](hello_onclick))
>
> works as expected.
>
> The 'document.<id>.events.<whatever>' notation is still the example in
> the Gestalt documentation, and if I use dlr-latest.js from
> gestalt.ironpython.net, it works just fine. I need to use IronPython
> 2.6.1, however, to access isolated storage.
>

Problem here is IronPython 2.6.1 shipped with an older version of
Microsoft.Scripting.Silverlight.dll, which does not support the .events
method ... it supports accessing events directly off of the HTML element
(document.foo.onclick += click_foo). Given that change, we didn't update the
gestalt.iron*.net binaries for 2.6.1, but it will be updated for 2.6.2. In
the meantime, I'll put a build 20100706 up there shortly.

- Jeff
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100706/30ab394a/attachment.html>


More information about the Ironpython-users mailing list