December 2004
Beginner
600 pages
13h 42m
English
Use the Info panel for the UI elements to change their properties. You can also change the label's title in the interface window by double-clicking the element.
In this exercise, you need to define one text field for input and two for output. If you name the three fields radius, circumference, and area, respectively, here's what your clicked handler might look like for the Calculate button:
on clicked theObject
try
set r to contents of text field "radius" of window "main" as number
on error
error "Please enter a number in the radius field!"
end
set contents of text field "circumference" of window "main" to 2 * pi * r
set contents of text field "area" of window "main" to pi * r ^ 2
end clicked
Read now
Unlock full access