[comp.sys.mac.programmer] expanding menus

rcook@eagle.wesleyan.edu (12/01/89)

I am wondering how you implement the expanding menus that you see in MacDraw II
and Canvas, for instance.  I was looking at the resource file for MacDraw II
and noticed several things.  The spelling submenu which is part of the Edit
menu (id 2) has an id of 11.  The key equiv field of the spelling item is the
escape character (27) and the mark char is 11, the id of the spelling menu. 
This seems fairly straightforward, but how do you include it in the menu bar? 
_Do_ you include it in the menu bar?  I would very much appreciate an
explanation and/or some code.  Thank you.

Randall Cook
rcook@eagle.wesleyan.edu
rcook%eagle@wesleyan.bitnet

steve@uswmrg2.UUCP (Steve Martin) (12/08/89)

rcook@eagle.wesleyan.edu writes:

 >I am wondering how you implement the expanding menus that you see in MacDraw II
 >and Canvas, for instance.  I was looking at the resource file for MacDraw II
 >and noticed several things.  The spelling submenu which is part of the Edit
 >menu (id 2) has an id of 11.  The key equiv field of the spelling item is the
 >escape character (27) and the mark char is 11, the id of the spelling menu. 
 >This seems fairly straightforward, but how do you include it in the menu bar? 
 >_Do_ you include it in the menu bar?  I would very much appreciate an
 >explanation and/or some code.  Thank you.

You have most of it.  Now all you have to do is GetNewMenu(11) in your code and
do an insertmenu on it.  I suggest doing this after inserting the higher level
menu that you want the submenu to appear in.  A complete example of how this
is done is in the book "Macintosh Programming Primer" by Dave Mark and
Cartwright Reed.

==>Steve