[comp.sys.mac.programmer] Command Key D.A.s

oster@dewey.soe.berkeley.edu (David Phillip Oster) (01/12/89)

In article <6229@hoptoad.uucp> tim@hoptoad.UUCP (Tim Maroney) writes:
>However, you can put a menu shortcut key into a DA.  Just put the magic
>menu manager metacharacters into the DA resource name.  Then when the
>application does an AddResMenu, the shortcut will appear normally in
>the apple menu.

It is not quite that simple. You'll get the command key in the menu,
because the D.A. has the metacharacters in its name all right.  However,
when the user actually types the command key, the program will do a:
	GetItem(GetMHandle(APPLEMENU), item, daName);
	OpenDeskAcc(daName); 
But the  daName GetItem returns doesn't have the metacharacters, so it
won't match the name of any D.A. when OpenDeskAcc() does a 
	GetNamedResource('DRVR', daName);
The reason SuiteCase works is, it is already overrriding most of the
resource manager, so it just checks for itself, as long as it is checking
for anything.

--- David Phillip Oster            --"When we replace the mouse with a pen,
Arpa: oster@dewey.soe.berkeley.edu --3 button mouse fans will need saxophone
Uucp: {uwvax,decvax}!ucbvax!oster%dewey.soe.berkeley.edu --lessons." - Gasee

brecher@well.UUCP (Steve Brecher) (01/13/89)

In article <27486@ucbvax.BERKELEY.EDU>, oster@dewey.soe.berkeley.edu
(David Phillip Oster) writes:
> In article <6229@hoptoad.uucp> tim@hoptoad.UUCP (Tim Maroney) writes:
> >However, you can put a menu shortcut key into a DA.  Just put the magic
> >menu manager metacharacters into the DA resource name.  Then when the
> >application does an AddResMenu, the shortcut will appear normally in
> >the apple menu.
> 
> It is not quite that simple. You'll get the command key in the menu,
> because the D.A. has the metacharacters in its name all right.

As I noted in another posting AddResMenu does not interpret metacharacters,
so there will be no command equivalent in the menu; there will just be
metacharacters at the end of the name, i.e., this scheme doesn't work.

> The reason [Suitcase] works is, it is already overrriding most of the
> resource manager, so it just checks for itself, as long as it is checking
> for anything.

Suitcase's and Suitcase II's AddResMenu patch inserts the key equivalent for
the Suitcase [II] DA into the apple menu structure.  Choice of the DA
via the command key is handled entirely by the Menu Manager in normal fashion.
-- 

brecher@well.UUCP (Steve Brecher)