Created
August 1, 2010 20:16
-
-
Save jleedev/503720 to your computer and use it in GitHub Desktop.
Hello world in IronPython with WinForms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ipy | |
import clr | |
clr.AddReference('System.Windows.Forms') | |
from System.Windows.Forms import Form, Button, Application | |
class HelloForm(Form): | |
def __init__(self): | |
super(HelloForm, self).__init__() | |
self.button = Button() | |
self.button.Click += self.on_button_clicked | |
self.button.Text = 'Click' | |
self.Controls.Add(self.button) | |
def on_button_clicked(self, sender, event): | |
sender.Text = 'Success!' | |
if __name__ == '__main__': | |
Application.Run(HelloForm()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment