1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- catch { load ./example[info sharedlibextension] example}
- puts "Creating some objects:"
- Circle c 10
- puts " Created circle [c cget -this]"
- Square s 10
- puts " Created square [s cget -this]"
- puts "\nA total of $Shape_nshapes shapes were created"
- c configure -x 20 -y 30
- s configure -x -10 -y 5
- puts "\nHere is their current position:"
- puts " Circle = ([c cget -x], [c cget -y])"
- puts " Square = ([s cget -x], [s cget -y])"
- puts "\nHere are some properties of the shapes:"
- foreach o "c s" {
- puts " [$o cget -this]"
- puts " area = [$o area]"
- puts " perimeter = [$o perimeter]"
- }
- puts "\nGuess I'll clean up now"
- rename c ""
- rename s ""
- puts "$Shape_nshapes shapes remain"
- puts "Goodbye"
|