Home THE HYPERCARD CENTER

HyperTalk Reference
Home » HyperTalk Reference » Properties

Note: This is a work in progress and will be formatting errors. Read more about the project on the home page.

menuMessage

set [the] menuMessage of menuItem ¬ of menu to ¬ "messageName [parameterList ]"

The menuMessage property returns or sets the message sent to the current card when the user chooses a menu item from a menu.

The menuMessage property returns empty if the menu item has no associated message.

HyperCard’s default menu items have no associated messages sent to the current card unless they have been explicitly set with this property.

A doMenu handler can override a menuMessage.


Examples

get the menuMessage of menuItem 1 of menu "Help"
if it is not empty then ...

set the menuMessage of menuItem "Print" of menu "File" to "myPrint"
set the menuMsg of menuItem 2 of menu 2 to "beep"
set the menuMsg of second menuItem of second menu to ¬
  "set the visible of field 1 to not the visible of field 1"

Placeholders

menuItem
An expression that evaluates to one of the following:

menuItem text
menuItem posInteger
ordinal menuItem
For example:

menuItem "New"
menuItem 2
second menuItem


menu
An expression that evaluates to one of the following:

menu text
menu posInteger
ordinal menu
For example:

menu "File"
menu 2
second menu


messageName
Any text string, without quotation marks, that represents the name of the message handler you want to write:

calculateDebt
selectWholeLine
As in:
on calculateDebt
on selectWholeLine theLine, aContainer


Related Topics

« marked | HyperTalk Reference | messageWatcher »


Version 0.7b1 (March 24, 2022)

Made with Macintosh

Switch to Modern View

Home
The HyperCard Center
HyperTalk Reference
Home » HyperTalk Reference » Properties

Note: This is a work in progress and will be formatting errors. Read more about the project on the home page.

menuMessage

set [the] menuMessage of menuItem ¬ of menu to ¬ "messageName [parameterList ]"

The menuMessage property returns or sets the message sent to the current card when the user chooses a menu item from a menu.

The menuMessage property returns empty if the menu item has no associated message.

HyperCard’s default menu items have no associated messages sent to the current card unless they have been explicitly set with this property.

A doMenu handler can override a menuMessage.


Examples

get the menuMessage of menuItem 1 of menu "Help"
if it is not empty then ...

set the menuMessage of menuItem "Print" of menu "File" to "myPrint"
set the menuMsg of menuItem 2 of menu 2 to "beep"
set the menuMsg of second menuItem of second menu to ¬
  "set the visible of field 1 to not the visible of field 1"

Placeholders

menuItem
An expression that evaluates to one of the following:

menuItem text
menuItem posInteger
ordinal menuItem
For example:

menuItem "New"
menuItem 2
second menuItem


menu
An expression that evaluates to one of the following:

menu text
menu posInteger
ordinal menu
For example:

menu "File"
menu 2
second menu


messageName
Any text string, without quotation marks, that represents the name of the message handler you want to write:

calculateDebt
selectWholeLine
As in:
on calculateDebt
on selectWholeLine theLine, aContainer


Related Topics

« marked | HyperTalk Reference | messageWatcher »

Version 0.7b1 (March 24, 2022)

Made with Macintosh

Switch to Retro View