77# FOR A PARTICULAR PURPOSE.
88# ===========================================================================
99
10+ import clr
11+ SWF = clr .AddReference ("System.Windows.Forms" )
12+ print SWF .Location
1013import System .Windows .Forms as WinForms
1114from System .Drawing import Size , Point
1215
@@ -24,8 +27,8 @@ def __init__(self):
2427
2528 # Create the button
2629 self .button = WinForms .Button ()
27- self .button .Location = Point (256 , 64 )
28- self .button .Size = Size (120 , 40 )
30+ self .button .Location = Point (160 , 64 )
31+ self .button .Size = Size (820 , 20 )
2932 self .button .TabIndex = 2
3033 self .button .Text = "Click Me!"
3134
@@ -36,8 +39,8 @@ def __init__(self):
3639 self .textbox = WinForms .TextBox ()
3740 self .textbox .Text = "Hello World"
3841 self .textbox .TabIndex = 1
39- self .textbox .Size = Size (360 , 20 )
40- self .textbox .Location = Point (16 , 24 )
42+ self .textbox .Size = Size (1260 , 40 )
43+ self .textbox .Location = Point (160 , 24 )
4144
4245 # Add the controls to the form
4346 self .AcceptButton = self .button
@@ -46,14 +49,19 @@ def __init__(self):
4649
4750 def button_Click (self , sender , args ):
4851 """Button click event handler"""
52+ print "Click"
4953 WinForms .MessageBox .Show ("Please do not press this button again." )
5054
5155 def run (self ):
5256 WinForms .Application .Run (self )
5357
5458
5559def main ():
56- HelloApp ().run ()
60+ form = HelloApp ()
61+ print "form created"
62+ app = WinForms .Application
63+ print "app referenced"
64+ app .Run (form )
5765
5866
5967if __name__ == '__main__' :
0 commit comments