User`s guide
Examples: Program GUI C omponents
When a user selects Edit > Copy > to file,noCopy callback is needed to
perform the action. Only the
Callback callback as sociated with the to file
item is required.
Suppose, however, that only certain objects can be copied to a file. You can
use the Copy item
Callback callback to enable or disable the to file item,
depending on the type of object selected.
The follow i ng code disables the to file item by setting its
Enable property
off. The menu item would then appear dimmed.
set(tofilehandle,'Enable','off')
Setting Enab le to on, would then enable the menu item.
Mouse Gestures and Menu Callback Behavior. Callback s for leaf me n u
items, such as for to file or to clipboard in the previous example, actuate
when you release the mouse over them. Callbacks for main menus (like Edit)
and non-leaf submenus (like Copy) actuate when you select them by sliding
the mouse pointer into them after they display. Even w hen it has no menu
items, a main menu callback actuates as soon as you select the menu. When a
submenu contains no items, its callback actuates upon releasing the mouse
over it. However, if a uimenu has one or more child uimenus, its callback
actuates as soon as you select it. The mouse button does not have to be d ow n
to trigger the callback of a m enu item that has children.
12-35