[IronPython] modal dialog example

jeff sacksteder jsacksteder at gmail.com
Thu Jul 6 18:42:42 CEST 2006


I'm have trouble mentally translating the Vb and C# examples I found online.
Could someone finish this trivial example of calling a modal dialog and
returning the choice that was selected?

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

from System.Windows import Forms

class MyMainForm(Forms.Form):
    def __init__(self):
        self.Text = 'Main Form'
        my_button = Forms.Button(Text='Choose one!')

class MyDialog(Forms.Form):
    def __init_(self):
        self.Text ='Dialog'
        egg_button = Forms.Button(Text='Eggs')
        spam_button = Forms.Button(Text='Spam')

app = MyMainForm()
Forms.Application.Run(app)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20060706/f3852aa4/attachment.html>


More information about the Ironpython-users mailing list