[IronPython] Still stuck on rich editor with IronPython and Silverlight

Michael Foord fuzzyman at voidspace.org.uk
Thu Apr 22 23:44:58 CEST 2010


Thanks very much - this is great news for us! I'm trying this now. 
Having to hardcode our AppManifest.xaml is unfortunate as we normally 
let Chiron generate this for us (whilst developing) - but I guess we 
could just recompile Chiron.

Much appreciated,

Michael

On 22/04/2010 23:13, Jimmy Schementi wrote:
> AH! Thanks Dino!
>
> In the XAP file there is an AppManifest.xaml, which specifies a version number. Ours (both what Chiron generates and what's on gestalt.ironpython.net) is still set to a version of SL2, for Moonlight compat, which turns on quirks mode when running in SL3+. Changing Chiron.exe.config's AppManifest template (or your own copy of AppManifest.xaml) to have SL4's version number will run without quirks mode enabled, hopefully letting you use the richtextbox.
>
> For gestalt.ironpython.net, we will have multiple XAPs depending on what SL version you want to use, and the SL3 and 4 XAPs will have updates version numbers.
>
> Michael, let me know how this works out for you.
>
> ~Jimmy
>
> On Apr 22, 2010, at 1:11 PM, "Dino Viehland"<dinov at microsoft.com>  wrote:
>
>    
>> 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-bounces at lists.ironpython.com [mailto:users-
>>> bounces at 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"<fuzzyman at 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 at lists.ironpython.com
>>>>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>>>>
>>>>>
>>>>>            
>>>> _______________________________________________
>>>> Users mailing list
>>>> Users at lists.ironpython.com
>>>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>>>
>>>>          
>>>
>>> --
>>> http://www.ironpythoninaction.com/
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.ironpython.com
>>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>>        
>    


-- 
http://www.ironpythoninaction.com/




More information about the Ironpython-users mailing list