[IronPython] Groping in the dark

Patrick O'Brien sum.ergo.code at gmail.com
Fri Dec 1 01:28:52 CET 2006


Am I missing something or is everyone else groping around in the dark as
much as I am when it comes to figuring out acceptable syntax in IronPython
versus other languages supported by the CLR.  What I'm doing is building a
simple app in Visual Studio C# 2005 Express to see what objects are
available and what properties they have.  I'm also looking at the generated
code.  But my translations into Python don't always work out as I expect.
For example, here are some differences I've come across:

For all of these examples I'm using this bit of code:

import clr
clr.AddReference('System.Windows.Forms')
import System.Windows.Forms as SWF


To add a separator to a menu you need to do this:

        Add('-')

Whereas this raises an exception:

        Add(SWF.ToolStripSeparator())

Various attempts at adding shortcut keys failed, but this works:

        open_item.Shortcut = SWF.Shortcut.CtrlO

Apparently the .ShortcutKeys property does not exist on menu items in
IronPython.

So my basic question is how does one learn all these anomalies other than by
trial and error?

-- 
Patrick K. O'Brien
Orbtech       http://www.orbtech.com
Schevo        http://www.schevo.org
Louie         http://www.pylouie.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20061130/a1c80faa/attachment.html>


More information about the Ironpython-users mailing list