Silverfrost Logo About Us | Contact Us
 

ADD_MENU_ITEM@

Platform

Win32(ClearWin+)

Purpose

To create a dynamic menu using %mn.

Syntax

 SUBROUTINE ADD_MENU_ITEM@( HANDLE, NAME, ENABLE,
+ CHECK, CALLBACK_FUNCTION)
 INTEGER HANDLE, ENABLE, CHECK, CALLBACK_FUNCTION
 CHARACTER*(*)  NAME

Description

By using %mn, menu items can be added at run time. This is of greatest use when you wish to show a file history or a list of open windows. Items are added one at a time to the end of the pop down menu that contains the handle.

In %mn (see Menu format) an asterisk (*) must be added where a text description would previously have been placed and a integer argument, instead of a call-back, must be provided to hold the handle.

For example:

i=winio@('%mn[&Window[*]]&',HANDLE)

handle can then be passed to ADD_MENU_ITEM@.

name is the new string to put into the menu i.e. the new menu item. enable controls the enabling of the item (1 for enabled, zero for disabled, i.e. greyed) and the check will add or remove a tick character (1 for checked, zero for unchecked). A call-back function must be provided so that ClearWin+ can act upon a menu selection. A separator is obtained if name is input as char(0).

Example

See Dynamic menus.

See also

REMOVE_MENU_ITEM@, %mn

 

 

Copyright © 1999-2017 Silverfrost Limited