[IronPython] Installing IP with the new CTP

2005-12-28 Thread Iain Mackay
Hi Martin

Thank you for your update on the tutorial, good news. I can get by without
animations for now - but do you know a solution for the threading problem in
the new environment? I can only do more substantial work by running from
scripts rather than interactively!

It's the eventually deliverable IP/WinFX combination that I'm interested in;
so I'd rather have something with shelf life despite the occasional
roadblock than revert to an obsolescent configuration of system software -
up to a point at least.

Regards
Iain MacKay


___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Experience installing IP with the new WPF CTP

2005-12-28 Thread Greg Kerr
Did you spell it RepeatBehaviour or RepeatBehavior (shouldn't have the 
u on this side of the ocean. ;-)

Greg

Iain Mackay wrote:
 I ran into several problems running the first Avalon example from the
 tutorial, using IP 0.9.6
 
 I should mention that at this time I was running .net Framework 2.0 and the
 Dec 2005 CTP preview of WPF x64 versions without the Framework SDK;
 installing the SDK subsequently did not change the behaviour.
 
 I noticed three problems:
 
 - I couldn't set the Text attribute on a Window object
 - I couldn't set the TextContent attribute on a TextBlock object
 - the class RepeatBehaviour seems not to be imported.
 
 Another strange aspect is that I get this far when I enter the script
 interactively to the console, but when I put the script in a file and
 execute it from the command line I get the exception:
 System.InvalidOperationException: The calling thread must be STA, as many
 UI components require this. on calling the Show method of the Window
 object. I think I might need to rebuild the console to sort this out - C#
 and .net threading models are rather a steep learning curve for this
 evening, so I've stuck to interactive experiments for now.
 
 Here's my console experience following the tutorial:
 
 G:\downloads\ironpython\IronPython-0.9.6\IronPython-0.9.6\Tutorialironpytho
 nconsole
 IronPython 0.9.6 on .NET 2.0.50727.42
 Copyright (c) Microsoft Corporation. All rights reserved.
 from avalon import *
 w=Window ()
 w.Show ()
 w.Text=Avalon app
 Traceback (most recent call last):
at shell
 TypeError: can't set arbitrary attributes on built-in type
 System.Windows.Window
 
 This is quite right, because Windows do not have a Text attribute. However,
 if you set Title, all is well.
 
 w.Content = TextBlock ()
 w.Content.TextContent = Hello IronPython!
 Traceback (most recent call last):
at shell
 TypeError: can't set arbitrary attributes on built-in type
 System.Windows.Contro
 ls.TextBlock
 
 Similarly, w.Content.Text = Hello IronPython, works just fine. You can
 discover the attributes of w of course just by:
 
 for (key, value) in w.__dict__.items (): print key, value
 
 (Iron)Python is so cool like that.
 
 w.Content.FontSize = 50
 a=DoubleAnimation(0.0,Duration(TimeSpan.FromSeconds(3)))
 a.RepeatBehaviour = RepeatBehaviour.Forever
 Traceback (most recent call last):
at shell
 NameError: name 'RepeatBehaviour' is not defined
 ^Z
 
 I didn't persist beyond here just yet. I suppose there have been some
 substantial changes in object properties during the evolution of WPF as seen
 in this latest preview, not yet reflected in the tutorial source - a life on
 the bleeding edge thing.
 
 import sys
 sys.path
 ['G:\\downloads\\ironpython\\IronPython-0.9.6\\IronPython-0.9.6\\Tutorial',
 'G:\\downloads\\ironpython\\IronPython-0.9.6\\IronPython-0.9.6\\bin\\Lib']
 
 Anyway, a whole lot of wonderful things are working straight out of the box,
 including the XAML calculator. This is going to be a lot of fun. Thanks to
 everyone for getting things this far. Am I doing something silly to get the
 threading problem?
 
 Iain MacKay

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Bitwise boolean operators and Forms

2005-12-28 Thread Tim Riley
I don't understand. Why would you use an or statement when assigning a dockstyle?~TimOn 12/28/05, jeff sacksteder 
[EMAIL PROTECTED] wrote:The code in this snippet fails, claiming the bitwise operator '|' is
unsupported for for DockStyles. Is this an unimplemented item, bug, or
misunderstanding on my part?


import sys
sys.LoadAssemblyByName('System.Windows.Forms')
from System.Windows.Forms import *

my_control = RichTextBox()
my_control.Dock = DockStyle.Right | DockStyle.Left
my_control.AutoSize = True

my_form = Form()
my_form.Controls.Add(my_control)
my_form.Show()

Application.Run(my_form)


___users mailing listusers@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


Re: [IronPython] Bitwise boolean operators and Forms

2005-12-28 Thread Keith J. Farmer








Perhaps he intends Anchor instead of Dock?





-

Keith J. Farmer

[EMAIL PROTECTED]













From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tim Riley
Sent: Wednesday, 28 December 2005
11:25





I don't understand. Why
would you use an or statement when assigning a dockstyle?

On 12/28/05, jeff
sacksteder 
[EMAIL PROTECTED] wrote:

The code in this snippet
fails, claiming the bitwise operator '|' is unsupported for for DockStyles. Is
this an unimplemented item, bug, or misunderstanding on my part?


import sys
sys.LoadAssemblyByName('System.Windows.Forms')
from System.Windows.Forms import *

my_control = RichTextBox()
my_control.Dock = DockStyle.Right | DockStyle.Left
my_control.AutoSize = True

my_form = Form()
my_form.Controls.Add(my_control)
my_form.Show()

Application.Run(my_form)













___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Installing IP with the new CTP

2005-12-28 Thread Martin Maly
Hi Iain,

The threading issue... It seems that STAThred is what works for most uses so in 
the next release we are making IronPython STA by default. We are also adding a 
command line parameter -X:MTA that will run the script / interactive prompt on 
MTAThread thread.

Hope this helps
Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Iain Mackay
Sent: Wednesday, December 28, 2005 1:49 AM
To: users@lists.ironpython.com
Subject: [IronPython] Installing IP with the new CTP

Hi Martin

Thank you for your update on the tutorial, good news. I can get by without
animations for now - but do you know a solution for the threading problem in
the new environment? I can only do more substantial work by running from
scripts rather than interactively!

It's the eventually deliverable IP/WinFX combination that I'm interested in;
so I'd rather have something with shelf life despite the occasional
roadblock than revert to an obsolescent configuration of system software -
up to a point at least.

Regards
Iain MacKay


___
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


Re: [IronPython] Bitwise boolean operators and Forms

2005-12-28 Thread Martin Maly



The DockStyle enum does not have the Flags attribute so 
IronPython doesn't add the bitwise operators.


From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of jeff 
sackstederSent: Wednesday, December 28, 2005 11:02 AMTo: 
users@lists.ironpython.comSubject: [IronPython] Bitwise boolean 
operators and Forms
The code in this snippet fails, claiming the bitwise operator '|' is 
unsupported for for DockStyles. Is this an unimplemented item, bug, or 
misunderstanding on my part?import 
syssys.LoadAssemblyByName('System.Windows.Forms')from 
System.Windows.Forms import *my_control = 
RichTextBox()my_control.Dock = DockStyle.Right | 
DockStyle.Leftmy_control.AutoSize = Truemy_form = 
Form()my_form.Controls.Add(my_control)my_form.Show()Application.Run(my_form)
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Bitwise boolean operators and Forms

2005-12-28 Thread jeff sacksteder
I was unclear on the nature of Anchor  Dock. Mistakes were made.On 12/28/05, Keith J. Farmer [EMAIL PROTECTED]
 wrote:













Perhaps he intends Anchor instead of Dock?

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] os.mkdir and os.rmdir

2005-12-28 Thread Sanghyeon Seo
I'd like to see os.mkdir and os.rmdir implemented in the next release
of IronPython.

Until then, this seems to work:

import System
import os
os.mkdir = System.IO.Directory.CreateDirectory
os.rmdir = System.IO.Directory.Delete

Seo Sanghyeon
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] os.path functions give wrong result on non-Windows platforms

2005-12-28 Thread Sanghyeon Seo
Currently, os.path module is same as ntpath, and gives wrong result on
non-Windows platforms.

IronPython 0.9.6 on .NET 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
 import os
 os.path.join('a', 'b')
'a\\b'

Currently, I have the following code in my site.py, but obviously this
is not the correct solution:

import System
import os
if str(System.Environment.OSVersion.Platform) == 'Unix':
import posixpath
os.path = posixpath

Any idea?

Seo Sanghyeon
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com