Namespaces are the biggest problem, LoadAssemblyByName and importing modules
are always a paint for me. The 'editor' or command line tool is also a bit
annoying as you can not copy or paste text from/to it which makes it harder
to work with, but when I had a poke about with MSIL Disassembler I found:
IronPythonConsole.FancyConsole, is this some kind of more advanced console,
as I often make a lot of small programs in IronPython to test things about
and something like a nicer IDE would be great, it is not like Jython where I
can get a book so better documentation would go a long way.
From: Martin Maly <[EMAIL PROTECTED]>
Reply-To: Discussion of IronPython
<users-ironpython.com@lists.ironpython.com>
To: "Discussion of IronPython" <users-ironpython.com@lists.ironpython.com>
Subject: RE: [IronPython] Making A Windows Form App
Date: Wed, 6 Jul 2005 13:13:17 -0700
MIME-Version: 1.0
Received: from moutng.kundenserver.de ([212.227.126.183]) by
mc2-f39.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 6 Jul 2005
13:13:30 -0700
Received: from [66.33.206.23] (helo=frida.dreamhost.com)by
mxeu13.kundenserver.de with ESMTP (Nemesis),id 0MKsEO-1DqGGy2JMq-0008HJ for
[EMAIL PROTECTED]; Wed, 06 Jul 2005 22:13:32 +0200
Received: from che.dreamhost.com (che.dreamhost.com [66.33.216.23])by
frida.dreamhost.com (Postfix) with ESMTPid 487F516D644; Wed, 6 Jul 2005
13:13:31 -0700 (PDT)
Received: from che.dreamhost.com (localhost [127.0.0.1])by
che.dreamhost.com (Postfix) with ESMTPid 8C59D1BA82; Wed, 6 Jul 2005
13:13:28 -0700 (PDT)
Received: from mail1.exchange.microsoft.com
(mail1.exchange.microsoft.com[131.107.76.156])by che.dreamhost.com
(Postfix) with ESMTP id CD58D1BA81for
<users-ironpython.com@lists.ironpython.com>;Wed, 6 Jul 2005 13:13:23 -0700
(PDT)
Received: from DF-GWY-01.Exchange.Corp.Microsoft.com ([157.54.54.62])
bymail1.exchange.microsoft.com over TLS secured channel withMicrosoft
SMTPSVC(6.0.3790.1830); Wed, 6 Jul 2005 13:11:39 -0700
Received: from df-hub-01.exchange.corp.microsoft.com (157.54.8.109)
byDF-GWY-01.Exchange.Corp.microsoft.com (157.54.54.62) with MicrosoftSMTP
Server id 8.0.324.11; Wed, 6 Jul 2005 20:11:38 +0000
Received: from df-hub-01.exchange.corp.microsoft.com ([157.54.8.109])
bydf-hub-01.exchange.corp.microsoft.com with
MicrosoftSMTPSVC(6.0.3790.1830); Wed, 6 Jul 2005 13:11:38 -0700
Received: from DF-BANDIT-BHD.Exchange.Microsoft.com ([157.54.54.229])
bydf-hub-01.exchange.corp.microsoft.com over TLS secured channel
withMicrosoft SMTPSVC(6.0.3790.1830); Wed, 6 Jul 2005 13:11:37 -0700
X-Message-Info: JGTYoYF78jHWL9MmXrcWU2adrcEMNnu1M4xRlrPMp/U=
Delivered-To: [EMAIL PROTECTED]
Content-Class: urn:content-classes:message
X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0
X-OriginalArrivalTime: 06 Jul 2005 20:11:37.0569
(UTC)FILETIME=[EA18B510:01C58266]
X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [IronPython] Making A
Windows Form App
Thread-Index: AcWCZWV8ChLmjDVBQuSUEVbp1jOpZQAARvlA
X-BeenThere: users-ironpython.com@lists.ironpython.com
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Discussion of IronPython
<users-ironpython.com.lists.ironpython.com>
List-Unsubscribe:
<http://lists.ironpython.com/listinfo.cgi/users-ironpython.com>,<mailto:[EMAIL PROTECTED]>
List-Archive:
<http://listserver.dreamhost.com/pipermail/users-ironpython.com>
List-Post: <mailto:users-ironpython.com@lists.ironpython.com>
List-Help:
<mailto:[EMAIL PROTECTED]>
List-Subscribe:
<http://lists.ironpython.com/listinfo.cgi/users-ironpython.com>,<mailto:[EMAIL PROTECTED]>
Errors-To: [EMAIL PROTECTED]
Return-Path: [EMAIL PROTECTED]
Hi Freddie,
Below is the working code. I would be interested to hear what you had
most problems with. Common difficulty is the LoadAssemblyByName
function. Feel free to post feedback to this discussion alias. We are
interested to hear what roadblocks developers encounter as they try to
use IronPython.
Martin
import sys
sys.LoadAssemblyByName("System.Drawing")
sys.LoadAssemblyByName("System.Windows.Forms")
import System
from System.Drawing import Point
from System.Windows.Forms import Form, Button, Application
def on_click(*args):
Application.Exit()
frm = Form(Text = "Hello World")
btn = Button(Text = "Goodbye", Location = Point(50,50))
btn.Click += on_click
frm.Controls.Add(btn)
Application.Run(frm)
> Freddie Witherden Wrote:
>
> Hi, I am trying to convert a very simple C# windows form test
> that I made into IronPython (to see that it can be done).
> However I have tried over 20 different ways with no luck. Can
> anyone help me? There is very very little documentation on
> IronPython, which I think needs to be addressed. The code
> is:
> using System;
> using System.Drawing;
> using System.Windows.Forms;
>
> namespace WinForms
> {
> public class HelloWorld : System.Windows.Forms.Form
> {
>
> private Button btn;
>
> public HelloWorld()
> {
> Text = "Hello World";
>
> btn = new Button();
> btn.Location = new Point(50,50);
> btn.Text = "Goodbye";
> btn.Click += new System.EventHandler(btn_Click);
>
> Controls.Add(btn);
> }
>
> static void Main()
> {
> Application.Run(new HelloWorld());
> }
>
> private void btn_Click(object sender, EventArgs e)
> {
> Application.Exit();
> }
> }
> }
_______________________________________________
users-ironpython.com mailing list
users-ironpython.com@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
users-ironpython.com mailing list
users-ironpython.com@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com