[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl-Toolbox] Altering the Menu Bar



At 5:02 pm +0100 20/11/00, Greenblatt & Seay wrote:

>Is the following code what you want?
>
>#!perl
>
>use Mac::Menus;
>
>  for $m (128..3000) {
>      $menuHandle = GetMenuHandle($m);
>      if($menuHandle) {
>	$menu = GetMenuBar();
>	print "$m = $menu -- $menuHandle\n";
>      }
>  }
>
>__END__

Many thanks for your thoughts. Yes, of course -- loop through all 
possible Menu ID's to see if a menuHandle is defined. (Like all good 
ideas obvious when someone points it out.)

The results pose some more puzzles however. A print out of ID, 
$menuHandle->enableFlags and $menuHandle->menuData produces this for 
a MacWindow:

	128 11011111111111111111111111111111 chr(20)
	129 11101110011010100000000000000000 File
	130 10000101011001010000000000000000 Edit
	131 11011111111111111111111111111111 Window
	201 11111111111111111111111111111111
	202 11111111111111111111111111111111
	203 11111111111111111111111111111111
	204 11111111111111111111111111111111
	205 11111111111111111111111111111111
	206 11111111111111111111111111111111

The first is the Apple Menu I think, but what does the chr(20) in the 
Data field represent? It doesn't seem to be the Icon ID.

Why is the 'Help' Menu not in the list and why are all other Menus to 
the right of it (e.g. Finder at the far end) ignored I wonder? (By 
contrast ClearMenu() zaps the lot.)

Where do Menus 201->206 come from and why are all the 32 flags set to 
1? Why is the Data field empty in each case? (RezEdit for MacPerl has 
nothing to say about Menus with these ID's.)

Any further thoughts? In particular what is the cast-iron rule for 
determining what Menus are actually up and running? At first sight it 
would seem any negative 'enableFlags' number might correspond to a 
disabled Menu, but then the Apple Menu (very much alive and  kicking) 
returns -5.

Alan Fry






==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-toolbox-request@macperl.org