summaryrefslogtreecommitdiffstats
path: root/Mac/Lib/test
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1995-06-06 13:08:40 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1995-06-06 13:08:40 (GMT)
commitb81cf9d61c71f9b5949b9424cec1f59ac4a426e8 (patch)
tree2b8fdc1f0dfd48b31a650f5a41864a8dc0b5ea7e /Mac/Lib/test
parentae8a68f40cd56aa952520260970ebd5b9d3fb95c (diff)
downloadcpython-b81cf9d61c71f9b5949b9424cec1f59ac4a426e8.zip
cpython-b81cf9d61c71f9b5949b9424cec1f59ac4a426e8.tar.gz
cpython-b81cf9d61c71f9b5949b9424cec1f59ac4a426e8.tar.bz2
Trying again to check it in. Changes to:
- Use Universal Headers as input - Change addpack calls to not depend on Guido's disklayout - Checkge testprograms to use new names for some functions
Diffstat (limited to 'Mac/Lib/test')
-rw-r--r--Mac/Lib/test/tmenu.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/Mac/Lib/test/tmenu.py b/Mac/Lib/test/tmenu.py
index 1b156d7..bc972a8 100644
--- a/Mac/Lib/test/tmenu.py
+++ b/Mac/Lib/test/tmenu.py
@@ -2,12 +2,19 @@
import os
from Menu import *
-
-# Since we can't (yet) list the mounted volumes, here's a list of some:
-my_volumes = ['C:', 'D:', 'E:', 'F:']
+import macfs
+import sys
def main():
global oldbar
+ my_volumes = []
+ while 1:
+ fss, ok = macfs.GetDirectory()
+ if not ok:
+ break
+ my_volumes.append(fss.as_pathname())
+ if not my_volumes:
+ return
oldbar = GetMenuBar()
ClearMenuBar()
makevolmenus(my_volumes)
@@ -40,10 +47,10 @@ def adddirectory(menu, dir, maxdepth = 1):
for file in files:
item = item+1
menu.AppendMenu('x') # add a dummy string
- menu.SetItem(item, file) # set the actual text
+ menu.SetMenuItemText(item, file) # set the actual text
fullname = os.path.join(dir, file)
if os.path.isdir(fullname):
- menu.SetItem(item, ':' + file + ':') # append colons
+ menu.SetMenuItemText(item, ':' + file + ':') # append colons
if maxdepth > 0:
id = nextid()
submenu = NewMenu(id, fullname)
@@ -58,3 +65,4 @@ def adddirectory(menu, dir, maxdepth = 1):
if __name__ == '__main__':
main()
+ sys.exit(1) # To allow the user to interact...