7
7
# FOR A PARTICULAR PURPOSE.
8
8
# ===========================================================================
9
9
10
+ import clr
11
+ SWF = clr .AddReference ("System.Windows.Forms" )
12
+ print SWF .Location
10
13
import System .Windows .Forms as WinForms
11
14
from System .Drawing import Size , Point
12
15
@@ -24,8 +27,8 @@ def __init__(self):
24
27
25
28
# Create the button
26
29
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 )
29
32
self .button .TabIndex = 2
30
33
self .button .Text = "Click Me!"
31
34
@@ -36,8 +39,8 @@ def __init__(self):
36
39
self .textbox = WinForms .TextBox ()
37
40
self .textbox .Text = "Hello World"
38
41
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 )
41
44
42
45
# Add the controls to the form
43
46
self .AcceptButton = self .button
@@ -46,14 +49,19 @@ def __init__(self):
46
49
47
50
def button_Click (self , sender , args ):
48
51
"""Button click event handler"""
52
+ print "Click"
49
53
WinForms .MessageBox .Show ("Please do not press this button again." )
50
54
51
55
def run (self ):
52
56
WinForms .Application .Run (self )
53
57
54
58
55
59
def main ():
56
- HelloApp ().run ()
60
+ form = HelloApp ()
61
+ print "form created"
62
+ app = WinForms .Application
63
+ print "app referenced"
64
+ app .Run (form )
57
65
58
66
59
67
if __name__ == '__main__' :
0 commit comments