new example

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@861 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2000-09-19 22:28:15 +00:00
commit 4fd0a45a9b
6 changed files with 147 additions and 0 deletions

View file

@ -0,0 +1,30 @@
# file: example.py
import example
# ----- Object creation -----
# Print out the value of some enums
print "*** color ***"
print " RED =", example.RED
print " BLUE =", example.BLUE
print " GREEN =", example.GREEN
print "\n*** Foo::speed ***"
print " Foo_IMPULSE =", example.Foo_IMPULSE
print " Foo_WARP =", example.Foo_WARP
print " Foo_LUDICROUS =", example.Foo_LUDICROUS
print "\nTesting use of enums with functions\n"
example.enum_test(example.RED, example.Foo_IMPULSE)
example.enum_test(example.BLUE, example.Foo_WARP)
example.enum_test(example.GREEN, example.Foo_LUDICROUS)
example.enum_test(1234,5678)
print "\nTesting use of enum with class method"
f = example.new_Foo()
example.Foo_enum_test(f,example.Foo_IMPULSE)
example.Foo_enum_test(f,example.Foo_WARP)
example.Foo_enum_test(f,example.Foo_LUDICROUS)