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

[MacPerl] Re: Menu-stuff (was: Mac::TextEdit and Edit menu crashes)



Alan Fry writes:
>>Kevin Reid <kpreid@ibm.net> writes Thu, 18 Jun 1998 08:29:03 -0400:
>>I was hoping that I could at least disable those menu items when one of
>>my windows was in front. Could you show me some example code for this?
>
>You should be able to do this:
>
>        use Mac::Menus;
>        ...
>        $mnu = GetMenu(130)  # gets handle to MacPerl's Edit Menu
>        DisableItem($mnu, 1) # disable item 1 "Undo" etc.
>        ...
>        EnableItem($mnu, 1)  # restore "Undo" to the menu when done
>
>This usually works, but I find checking right now, it does _not_ seem to
>work with MacPerl's Edit Menu. I don't know why. Maybe someone else can
>shed some light on this? (PPC/MacOS 8.1/MacPerl v1.2.0r4).
>

#!perl -w

use Mac::Menus;

$old = GetMenuBar();
ClearMenuBar() 	;
print $a=<STDIN>;
SetMenuBar($old);  #Don't forget this line or you will be in big drouble :-)

Runing this little script on my Mac (PPC, OS 8.0) can disable menues but
not the whole menu-bar:-(

[1] Starting the script, while the <STDIN/SDTOUT> console-window is closed
will put an menu bar with just an enabled Window menue on the screen.

[2] Starting the script with the <STDIN/SDTOUT> console-window still open,
will lead to an unpredictable outcome.
Mostly I get an menu bar which looks enabled but actually it is imposible to
pull them down. Sometimes I get an empty menu-bar.

Does other MacPerl user have the same results? (Some email reports would be nice)

Searching for MBAR-ids, trying to understand the MDEFs...., BUT I won't give up:-)
How much is Mercutio involved in this stuff? (Kind of talking to myself)

Andreas Marcel



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch