Alan,
Wonderful explanation. This helped immensely.
Of course, it opened up more questions <g>...
My first confusion is with the MenuHandle numbers. Since we grab a
MenuHandle of 130, and then delete that id, we can never reclaim it within
the current script, so we reinsert it as id+1, as below (which deletes the
original edit menu and puts it back):
> my $oldEdit = GetMenuHandle(130);
> InsertMenu($oldEdit, 131);
More id confusion. If we create these new menus with specific id's, how
come we don't use the same id's to insert them into the menubar?
> my $newFile = MacMenu->new ( 2049, 'File', ( ... ) )
> my $newEdit = MacMenu->new ( 2048, 'Edit', ( ... ) )
>
> InsertMenu $newEdit, 131;
> InsertMenu $newFile, 2048;
And how come the "Windows" menu doesn't nicely show up in the looping code
you sent? The modified my-code that you responded with worked nicely,
except that it still showed the "Windows" menu, which shouldn't be there
(neither should the Help menu, but hey, at least I can see that in the
list).
Finally, when I quit out of the script, I get back into the MacPerl window,
with the menu's all screwy - with "Windows" first, and then File, Edit,
etc. after that. This happens in other cases - my "Editor" menu is replaced
with "BBEdit" and that becomes the first menu entry when I quit the
modified my-code you sent with your last email.
And how major is this, ie. how "proper" is it to replace MacPerl's menu
when I'll be using MacPerl::Quit(2) to quit out of the script entirely when
it dies? Do I need to worry about the restore_menu_bar routine if the old
menu's will show up for a fraction of a second before the Finder menu's
take over?
Wonderful help, this list is (now I get to start playing around with the
GUI stuff that you helped me with a few weeks ago).
--
Morbus Iff
Here we have MorbusBird - Able to fly across all boundaries,
^ migrate his way unfailingly into every inbox and browser
/( )\ across the land, with the freedom to (anywhere he wants to!)
/.\ drop his shat... Devil Shat:<http://www.disobey.com/devilshat/>
-06--- <\/> ---- <http://www.disobey.com/> --- Bad Ascii, Short Notice ----