/tags/v1-3-6/SWIG/Examples/tcl/enum/example.tcl

# · TCL · 34 lines · 20 code · 11 blank · 3 comment · 0 complexity · 68d17a1ca638a8731afe68b7502a92c2 MD5 · raw file

  1. # file: example.tcl
  2. catch { load ./example.so example}
  3. catch { load ./example.dll example} ;# Windows
  4. # ----- Object creation -----
  5. # Print out the value of some enums
  6. puts "*** color ***"
  7. puts " RED = $RED"
  8. puts " BLUE = $BLUE"
  9. puts " GREEN = $GREEN"
  10. puts "\n*** Foo::speed ***"
  11. puts " Foo_IMPULSE = $Foo_IMPULSE"
  12. puts " Foo_WARP = $Foo_WARP"
  13. puts " Foo_LUDICROUS = $Foo_LUDICROUS"
  14. puts "\nTesting use of enums with functions\n"
  15. enum_test $RED $Foo_IMPULSE
  16. enum_test $BLUE $Foo_WARP
  17. enum_test $GREEN $Foo_LUDICROUS
  18. enum_test 1234 5678
  19. puts "\nTesting use of enum with class method"
  20. Foo f
  21. f enum_test $Foo_IMPULSE
  22. f enum_test $Foo_WARP
  23. f enum_test $Foo_LUDICROUS