Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!nrl-cmf!ames!pasteur!ucbvax!dewey.soe.berkeley.edu!oster From: oster@dewey.soe.berkeley.edu (David Phillip Oster) Newsgroups: comp.sys.mac.programmer Subject: Re: Problems With Menus Message-ID: <27812@ucbvax.BERKELEY.EDU> Date: 29 Jan 89 18:27:52 GMT References: <8534@orstcs.CS.ORST.EDU> <6400@hoptoad.uucp> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster) Organization: School of Education, UC-Berkeley Lines: 28 I wish people would stop reading and copying all those stupid example programs that allocate an array, define one set of menu numbers for resources, a second set for indices into the array, and have a loop that gets the menu and inserts the menu. It is miles more maintable to just do: SetMenuBar(GetNewMBar(128)); DrawMenuBar(); and when the program needs to reference a menu handle, do: GetMHandle(APPLEMENU); Also, you might as well number your menus consequatively starting from 1. GetNMBar(), in case you missed it reading inside Mac, takes an MBAR resource that is a list of menu ids, and it builds a menu bar of those menus in that order. In Rmaker, I usually just say: Type MBAR=GNRL ,128 (32) .I 6 1 2 3 4 5 6 ;; the first integer is the count. --- David Phillip Oster --"When we replace the mouse with a pen, Arpa: oster@dewey.soe.berkeley.edu --3 button mouse fans will need saxophone Uucp: {uwvax,decvax}!ucbvax!oster%dewey.soe.berkeley.edu --lessons." - Gasee