Thanks Greg!!

I had install Avalon as a pre-requisite for Microsoft Max but haven yet 
come around to playing with this new API. Thank you for getting me half 
way into it with this simple app.

Cool!!

-- Richard Hsu
> Message: 1
> Date: Tue, 18 Oct 2005 13:38:19 -0500
> From: "Greg Kerr" <[EMAIL PROTECTED]>
> Subject: [IronPython] IronPython and WPF .. too cool
> To: [email protected]
> Message-ID: <[EMAIL PROTECTED]>
>
> Don't know if anyone wants to see it, or if everyone's way past it, but here 
> is a simple WPF app in IronPython:
>
> import sys
> sys.LoadAssemblyByName( "WindowsBase")
> sys.LoadAssemblyByName( "PresentationCore")
> sys.LoadAssemblyByName( "PresentationFramework")
> sys.LoadAssemblyByName( "UIAutomationProvider")
> sys.LoadAssemblyByName( "UIAutomationTypes")
>
> from System import *
> from System.Windows import *
> from System.Windows.Controls import *
> from System.Windows.Media import *
> from System.Windows.Media.Animation import *
>
> class MyApp (Application):
>
>     def __init__( self):
>
>         pass
>
>     def OnStartup( self, evt):
>
>         mainWindow              = Window();
>         rootPanel               = StackPanel();
>         rootPanel.Background    = SolidColorBrush( Colors.Green);
>
>         txtElement              = TextBlock()
>         txtElement.Margin       = Thickness( 10)
>         txtElement.Text         = "A TextBlock"
>         txtElement.FontSize     = 24
>         txtElement.Foreground   = SolidColorBrush( Colors.White)
>
>         mainWindow.Content      = rootPanel
>         mainWindow.Title        = "WPF Window from IronPython"
>
>         rootPanel.Children.Add( txtElement)
>
>         opacityAnim = DoubleAnimation( 0.0, 
> Duration(TimeSpan.FromMilliseconds(1000)))
>         opacityAnim.AutoReverse = True
>         opacityAnim.RepeatBehavior = RepeatBehavior.Forever
>         txtElement.BeginAnimation(Control.OpacityProperty, opacityAnim)
>
>         mainWindow.Show()
>
> app = MyApp()
> app.Run()
_______________________________________________
users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to