[comp.sys.mac.programmer] Problem with Menus

cecala@m2.csc.ti.com (Tony Cecala) (12/08/89)

I'm posting this for a friend who would like to finish this journalling 
desk accessory for a research project in our lab.

Goal - To pop down a menu in the menu bar using the standard menu
       definition procedure. (This is not in response to a mouseclick
       by the user in the menubar, but rather a keyclick.)
  
Environment - Mac II, Finder 6.1,  System 6.02, Think C 3.01

Problem - The code I wrote to pop down a menu has no apparent effect.

Questions -

    1. Does the following logic make sense?

    Save the current port.
    SetPort to the window manager port.
    Step through the MenuList to get a handle to the appropriate 
    MenuRecord then get the handle to the menu's menu definition procedure.
    Call GetResource to get a handle to the MBDF resource.
    Call MBDF with message 7 to save the bits behind the menu.
    Call the menu definition procedure.
    
   2. If the above makes sense, what are the proper calling arguments to
      MBDF?

    Specifically, 
    
     a. What is mbVariant?  I'm setting it to 0.
     b. When the documentation says none for parameter 1, does that
        mean don't pass parameter 1 or parameter 1's value doesn't
        matter?
     c. When parameter 2 calls for a menuRect, does this mean to pass
        the address of a Rect?  The same thing on message 9.  How 
        does it return a Rect?  Who allocates the space for the rect?
     d. Do I need to call message 9?  Sometimes, the menu records
        appear to have menuHeight and menuWidth initialized to -1.
     e. Is 6 byte offset synonymous with byte offset?  I'm assuming
        that if the parameter requires a 6 byte offset, that means I
        should pass the menu number x6.
     
      
   3. Do I need to worry about a color window manager port?
      If so, how do I switch to and from it?

Due to the perhaps esoteric nature of the problem perhaps responses
should be sent directly by e-mail.  Any help, code fragments,
incantations would be greatly appreciated--a dissertation hinges on this
program.


Tony Cecala
User Interface Designer              PO Box 655303, MS 8223, Dallas, TX 75265
Texas Instruments, Inc.              Arpanet: cecala@m2.csc.ti.com
-------------------------            *I speak for me only*