[IronPython] Silverlight 4 and RichTextBox
Michael Foord
fuzzyman at voidspace.org.uk
Mon Apr 12 13:40:56 CEST 2010
On 12/04/2010 13:33, Michael Foord wrote:
> Hello all,
>
> I'm trying to use the new RichTextBox from Silverlight 4 with
> IronPython. I have IronPython 2.6.1 RC and Silverlight 4 RC installed
> (Windows). It fails with a "SystemError: Specified method is not
> supported" when instantiating the RichTextBox.
>
If I attempt to create the RichTextBox from xaml instead of code the
error is: "SystemError: AG_E_UNKNOWN_ERROR [Line: 5 Position: 25]"
The xaml is:
<Canvas x:Class="System.Windows.Controls.Canvas"
xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<RichTextBox x:Name="text" />
</Canvas>
All the best,
Michael
> The code is:
>
>
> from System.Windows import Application
> from System.Windows.Controls import Canvas, RichTextBox
>
> canvas = Canvas()
> text = RichTextBox()
> text.Text = 'Hello World from IronPython'
> canvas.Children.Add(text)
>
> Application.Current.RootVisual = canvas
>
> Any ideas?
>
> All the best,
>
> Michael Foord
>
--
http://www.ironpythoninaction.com/
More information about the Ironpython-users
mailing list