CDMenuSpecialsImpl.mesa (part of ChipNDale)
Copyright © 1985 by Xerox Corporation. All rights reserved.
by Christian Jacobi, June 5, 1985 8:02:35 pm PDT
Last Edited by Christian Jacobi, June 28, 1985 5:58:05 pm PDT
SelectOneOf:
PUBLIC
PROC[ref: SymTab.Ref, label: Rope.
ROPE]
RETURNS [key: Rope.
ROPE←
NIL] =
--Interactive selection
--NIL if discarded
BEGIN
cnt: INT ← 0;
menu, firstMenu: REF;
EachEntry: SymTab.EachPairAction = {
--key: Rope.ROPE
quit ← FALSE;
IF cnt>10
THEN {
newMenu: REF ← CDMenus.CreateMenu[label: label];
CDMenus.CreateEntry[menu: menu, entry: "more ?", key: newMenu];
menu ← newMenu;
cnt ← 0
};
cnt ← cnt+1;
CDMenus.CreateEntry[menu: menu, entry: key, key: key]
};
menu ← firstMenu ← CDMenus.CreateMenu[label: label];
[] ← ref.Pairs[EachEntry];
IF menu#firstMenu
THEN
CDMenus.CreateEntry[menu: menu, entry: "again ?", key: firstMenu];
key ← NARROW[CDMenus.CallMenu[firstMenu]];
END;