-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestButton.t
33 lines (25 loc) · 902 Bytes
/
TestButton.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
module TestButton where
import COCOA
import CTButton
root w = class
osx = new cocoa w
w1 = new mkCocoaWindow w
button1 = new mkCocoaButton w
button2 = new mkCocoaButton w
start app = action
w1.setPosition ({x=100,y=100})
w1.setSize ({width=400,height=400})
w1.setBackgroundColor web_gray
w1.setTitle "TestButton"
button1.setTitle "I am button 1"
button1.setPosition ({x=100,y=100})
button1.setClickResponder (new buttonClickHandler button2)
w1.addComponent button1
button2.setTitle "I am button 2"
button2.setPosition ({x=100,y=130})
w1.addComponent button2
app.addWindow w1
result action
osx.startApplication start
buttonClickHandler otherButton = class
result action otherButton.setSize ({width=200,height=150})