Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!mcsun!i2unix!inria!imag!bordier From: bordier@imag.imag.fr (Jerome Bordier) Newsgroups: comp.sys.mac.programmer Subject: Re: Shift-Command-Key in Menus Message-ID: <12386@imag.imag.fr> Date: 3 Sep 90 13:04:54 GMT Reply-To: bordier@imag.fr (Jerome Bordier) Organization: IMAG Institute, University of Grenoble, France Lines: 30 Here is a summary of both responses I have received and my personal investigations. As Brendan McCarthy says, the best solution is writing your own MDEF : " Remember, your MDEF must check which system version is running in order to properly space command key equivalents (2 extra pixels for 6.0.3, I believe). " MacWrite II uses a pseudo-icon definition : a special icon number is stored in the resource for each item which has the shift-command-key equivalent (it is easy to see that with ResEdit or REdit). So your MDEF has to detect this special number in the menu data and draw the arrow instead of an icon. There is yet another way with less programming effort (see Inside Macintosh, function MenuSelect). You can store in the global variables MenuHook and MBarHook the adresses of routines that will be called during Menuselect. You have to write two routines, say my_MBarHook and my_MenuHook. MBarHook is passed (as parameter) a pointer to the Menu rectangle. So my_MenuHook can calculate menu item rectangle coordinates and draw the little arrow in front of the clover symbol. Your MenuHook must check two cases : disabled item or menu and highlighted item, and draw with the adequate pen pattern (grey, white or black). You can use the pseudo icon method to parametrize the hook (first detect the menu items, second set icon number to zero in the menu data). Bis repetita : MacWrite is a registered trademark of Claris inc. -- Jerome BORDIER Laboratoire de Structures Discretes et de Didactique IMAG B.P. 53 X 38041 GRENOBLE Cedex FRANCE TEL: (33) 76 51 45 53 FAX: (33) 76 51 45 55 INTERNET: bordier@imag.Fr UUCP: bordier@imag (uunet.uu.net!imag!bordier)