Commits

Anonymous committed abea17b

ironpython gist by jleedev

  • Participants
  • Parent commits 5d21541

Comments (0)

Files changed (1)

python/ipy/ipy.py

+#!/usr/bin/env ipy
+#
+# http://gist.github.com/503720
+#
+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())