deragon@acf8.UUCP (John Paul Deragon) (04/26/88)
Well I have a question that is very basic but is driving me batty. I am starting off my Macintosh programming with Lightspeed C 2.15. I wrote several small programs using hard coded windows and menus. So I learned this was a no-no. So-far I have gotten the windows as resources. The problem I am having is calling up the menus. What is the proper way to do this? Is is like: short MY_MENU_ID=256; GetNewMBar(MY_MENU_ID); or something more difficult like.. Well I dont really know, thats why I am here.. :-) Any help in this matter would be greatly appreciated. Thanks.. _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- | John P. Deragon Phone: 212-998-3467 | | NYU Robotics and Intelligent Automation Lab _ | | deragon@cadman.nyu.edu-arpa DELPHI:JPDERAGON /(~)\ | | deragon@acf8.nyu.edu-arpa Compuserve:72160,2010 U | _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ WOOF! _-_ |-_-_-_|
oster@dewey.soe.berkeley.edu (David Phillip Oster) (04/28/88)
If you declare your menus as follows:
-----------------Begin .r fragment----------------------
Type MENU
,1 (4)
\14
,2 (4)
File
New/N
Close/W
(-
Quit/Q
,3 (4)
Edit
Undo/Z
(-
Cut/X
Copy/C
Paste/V
Clear
Type MBAR=GNRL
,128 (36)
.I
3 1 2 3
-----------------End .r fragment----------------------
then:
enum {
APPLEMENU = 1,
FILEMENU,
EDITMENU };
main(){
...
SetMenuBar(GetNewMBar(128));
DrawMenuBar();
AddResMenu(GetMHandle(APPLEMENU), 'DRVR');
}
creates the whole menu bar for you. (Hierarchical
sub-menus are left as an exercise for the reader.)