Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!jarthur!jwinterm From: jwinterm@jarthur.Claremont.EDU (Jim Wintermyre) Newsgroups: comp.sys.mac.programmer Subject: Re: Icons in popup menus (like Std. File dialog)? Message-ID: <11012@jarthur.Claremont.EDU> Date: 28 Feb 91 08:05:25 GMT References: <62972@bbn.BBN.COM> <11707@adobe.UUCP> Distribution: comp Organization: Harvey Mudd College, Claremont, CA 91711 Lines: 50 In article francis@uchicago.edu (Francis Stracke) writes: >In article <11707@adobe.UUCP> hawley@adobe.COM (Steve Hawley) writes: > > In article <62972@bbn.BBN.COM> rmitchel@bbn.com (Rob Mitchell) writes: > | [1] How does the "mini" icon get inserted into the popup menu > | in the standard file dialog window? You know, the one > | that looks like folder/files/appls/etc. I'd like to > | insert an icon in my popup menu. Where do I get the > | "mini" icon? From some "ICN#" rsrc? Do I append it to > | menu item just before drawing (kinda like check marks)? > > Can't answer this exactly, but you get the small icon from the SICN > resources in the system file (or your own file or wherever). To get them > in a pop-up menu is something I've never tried. I image you'd have to > write your own MDEF to handle that... > >You can now use the standard MDEF to place a SICN in your menu; don't >remember just how you work the resource information, but ResEdit 2.1 >will do it for you. > >I assume it would work on a popup. It's the same MDEF doing the >drawing, isn't it? Well, as far as I know it is. I replied to the original sender, but I can't remember if I posted it or not. So here goes. Macintosh technical note #253 documents how to include SICNs or reduced size regular ICONs next to menu items, like Multifinder does. This facility came about when Multifinder was being created, so it isn't documented in Inside Mac. The first thing you need to do is place a value of $1D in the cmdChar field of menuItem for a reduced ICON, or a value of $1E for a SICN. You then place the resource ID of the appropriate ICON or SICN, minus 256, in the itemIcon field. Note that this means that the resource ID of your ICON or SICN must be 257 or greater. Also, since the cmdChar field is used up, you can't have keyboard equivalents for these menu items. Oh well. In code: SetItemCmd(theMenu,item,$1D) { reduced icon (reduced ICON) } SetItemIcon(theMenu,item,icon) or SetItemCmd(theMenu,item,$1E) { small icon (SICN) } SetItemIcon(theMenu,item,icon) That's it. It works for a normal menu, so there's no reason why it shouldn't work for a popup. - Jim Wintermyre