Ok, I know what's going on here, but I don't know the exact solution. I'm hoping one of you two know the solution. The good news is there's no bug, the rich text box isn't supposed to work! :)
What's going on is that quirks mode is disabling the creation of the rich text box. This appears to be due to a version check against the version that's coming from the XAP. So I guess fixing some Silverlight ' version specified in the XAP file will fix this - I don't know if that's a XAP being generated by Chiron or if it's something on gestalt.ironpython.net. > -----Original Message----- > From: users-boun...@lists.ironpython.com [mailto:users- > boun...@lists.ironpython.com] On Behalf Of Michael Foord > Sent: Friday, April 16, 2010 6:21 PM > To: Discussion of IronPython > Cc: Jimmy Schementi > Subject: Re: [IronPython] Still stuck on rich editor with IronPython > and Silverlight > > On 17/04/2010 03:19, Jimmy Schementi wrote: > > Michael, let's get Dino in on this ... > > > > Dino, This seems like our fault, but I'm not savvy enough to track it > down or verify my claim. Seems like it doesn't work regardless of > invoking via reflection or ref.emit code; calling it's constructor > 10,000 times still gave the same result. As Michael said, doing > anything with RichTextBox fails when invoked from IronPython, but works > fine when invoked without IronPython on the stack (pure C# app, for > example). I'm amazed that it fails when *called* from C#, meaning that > IronPython is doing something to make statically compiled code fail. > > > > Thanks for looking at this Jimmy. IronPython must be doing something > really quite impressive here. :-) > > All the best, > > Michael > > > We can look at this together on Monday unless you get to it sooner; I > thought I knew how to use windbg but failed miserably at doing anything > useful, so you'll have to help :) > > > > ~Jimmy > > > > On Apr 16, 2010, at 6:01 PM, "Michael > Foord"<fuzzy...@voidspace.org.uk> wrote: > > > > > >> Hello all, > >> > >> I'm still stuck on using the Silverlight 4 RichTextBox from > IronPython. Unfortunately this is blocking our project. :-( > >> > >> Instantiating the RichTextBox directly or loading it from xaml > fails. > >> > >> A wrapper class in C# that instantiates the RichTextBox and returns > it to IronPython fails. > >> > >> A wrapper C# class that internally creates the RichTextBox but never > returns it to IronPython *still* fails. Anyone got any suggestions for > possible alternative approaches? > >> > >> My latest (failing) attempt. C#: > >> > >> public static class Foo > >> { > >> static RichTextEditor _editor = null; > >> > >> public static void Create(StackPanel panel) > >> { > >> _editor = new RichTextEditor(); > >> panel.Children.Add(_editor); > >> } > >> } > >> > >> IronPython: > >> > >> clr.AddReference('SilverlightTextEditor, Version=1.0.0.0, > Culture=neutral') > >> > >> canv = Canvas() > >> xaml = Application.Current.LoadRootVisual(canv, "app.xaml") > >> > >> from SilverlightTextEditor import Foo > >> panel = StackPanel() > >> xaml.Children.Add(panel) > >> > >> Foo.Create(panel) > >> > >> (Note that RichTextEditor is a standalone UserControl editor > component built on top of the RichTextBox. It works fine from C#.) > >> > >> All the best, > >> > >> Michael Foord > >> > >> -- > >> http://www.ironpythoninaction.com/ > >> > >> _______________________________________________ > >> Users mailing list > >> Users@lists.ironpython.com > >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > >> > >> > > _______________________________________________ > > Users mailing list > > Users@lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > -- > http://www.ironpythoninaction.com/ > > _______________________________________________ > Users mailing list > Users@lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com