home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-02-19 | 1.0 KB | 47 lines | [TEXT/MPS ] |
- Program SetMenu;
- {
- This program is an MPW tool which changes the text for a specified
- menu item. Call it from the MPW Shell as follows:
-
- SetMenu menuName itemNo itemText
-
- where menuName is the name of the menu to be altered, itemNo is the
- number of the menu item, and itemText is the new item text.
-
- Written by LDO 1988 October 29.
- Modified 1989 January 4 to initialise QuickDraw (just in case) and
- move useful stuff to MenuStuffCommon for use by the other tools in this set.
- }
-
- Uses
- MemTypes,
- QuickDraw,
- OSIntf,
- ToolIntf,
- PackIntf,
- IntEnv,
- MenuStuffCommon;
-
- Var
- TheMenu : MenuHandle;
-
- Begin
- InitGraf(@ThePort);
- If ArgC > 3 then
- Begin
- TheMenu := FindMenu(ArgV^[1]^);
- If TheMenu <> Nil then
- SetItem(TheMenu, StringToNum(ArgV^[2]^), ArgV^[3]^)
- else
- Begin
- Writeln(Diagnostic, '### ', ArgV^[0]^, ' - menu "', ArgV^[1]^, '" not found');
- IEExit(2)
- End
- End
- else
- Begin
- Writeln(Diagnostic, '### ', ArgV^[0]^, ' - not enough arguments');
- IEExit(1)
- End
- End {SetMenu}.
-