Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!srcsip!gorby!mnkonar From: mnkonar@gorby.SRC.Honeywell.COM (Murat N. Konar) Newsgroups: comp.sys.mac.programmer Subject: Re: Implementing a Talking Menu Message-ID: <19742@srcsip.UUCP> Date: 1 Apr 89 00:19:52 GMT References: <3937@bgsuvax.UUCP> <7826@boulder.Colorado.EDU> Sender: news@src.honeywell.COM Reply-To: mnkonar@gorby.UUCP (Murat N. Konar) Organization: Honeywell Systems & Research Center, Camden, MN Lines: 32 In article <7826@boulder.Colorado.EDU> ewing@tramp.Colorado.EDU (EWING DAVID JAMES) writes: >Walt, in your article you say: > >>"We are working on a desk accessory that will speak the menu choice on a >>mouse event. I would like to know how to get the English text of the menu >>and the menu choice (whichever the cursor was over) on mouseDOWN. > > >If you actually want to speek the menu item that the mouse is over as it's >being tracked through the choices, I'd say you actually have to write an >MDEF for this (even yuckier). Not true. Sorry for the following vagueness but I don't have my references with me. Here's how you can do it: There is a low memory global that holds a pointer to a routine that gets called whenever there is a menu down. It gets called repeatedly until the mouse is released. (Sorry I can't remember the name or location of this global. Check IM X-Ref) Point this at a routine that examines another low memory global (which I also can't remember the name of) that holds the menuID and item currently highlighted. Using the menu ID and item you can get the item text by calling GetMenuItem. I just remembered: the routine pointer is called MenuHook and I think the menuID and Item global is called MenuChoice. Look 'em up. Standard warnings about the use of lowmwmory globals apply. ____________________________________________________________________ Have a day. :^| Murat N. Konar Honeywell Systems & Research Center, Camden, MN mnkonar@SRC.honeywell.com (internet) {umn-cs,ems,bthpyd}!srcsip!mnkonar(UUCP)