diff options
Diffstat (limited to 'Mac/Demo/calldll/samplecalldll.py')
-rw-r--r-- | Mac/Demo/calldll/samplecalldll.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Mac/Demo/calldll/samplecalldll.py b/Mac/Demo/calldll/samplecalldll.py new file mode 100644 index 0000000000..3a5bb5c4a1 --- /dev/null +++ b/Mac/Demo/calldll/samplecalldll.py @@ -0,0 +1,24 @@ +# +# Test calldll. Tell the user how often menus flash, and let her change it. +# + +import calldll +import sys + +# Obtain a reference to the library with the toolbox calls +interfacelib = calldll.getlibrary('InterfaceLib') + +# Get the routines we need (see LowMem.h for details) +LMGetMenuFlash = calldll.newcall(interfacelib.LMGetMenuFlash, 'Short') +LMSetMenuFlash = calldll.newcall(interfacelib.LMSetMenuFlash, 'None', 'InShort') + +print "Menus currently flash",LMGetMenuFlash(),"times." +print "How often would you like them to flash?", + +# Note: we use input(), so you can try passing non-integer objects +newflash = input() +LMSetMenuFlash(newflash) + +print "Okay, menus now flash", LMGetMenuFlash(),"times." + +sys.exit(1) # So the window stays on-screen |