STYLE: Nightly Version update
[cmake.git] / Tests / SwigTest / runme.tcl
blobc7f4725603b9fd0d7019c151e15c7696a0a36a5f
1 # file: runme.tcl
3 # This file illustrates the high level C++ interface.
4 # In this case C++ classes work kind of like Tk widgets
6 catch { load ./example[info sharedlibextension] example}
8 # ----- Object creation -----
10 puts "Creating some objects:"
11 Circle c 10
12 puts " Created circle [c cget -this]"
13 Square s 10
14 puts " Created square [s cget -this]"
16 # ----- Access a static member -----
18 puts "\nA total of $Shape_nshapes shapes were created"
20 # ----- Member data access -----
22 # Set the location of the object
24 c configure -x 20 -y 30
25 s configure -x -10 -y 5
27 puts "\nHere is their current position:"
28 puts " Circle = ([c cget -x], [c cget -y])"
29 puts " Square = ([s cget -x], [s cget -y])"
31 # ----- Call some methods -----
33 puts "\nHere are some properties of the shapes:"
34 foreach o "c s" {
35 puts " [$o cget -this]"
36 puts " area = [$o area]"
37 puts " perimeter = [$o perimeter]"
40 # ----- Delete everything -----
42 puts "\nGuess I'll clean up now"
44 # Note: this invokes the virtual destructor
45 rename c ""
46 rename s ""
48 puts "$Shape_nshapes shapes remain"
49 puts "Goodbye"