Next Previous Contents

14. Menu Functions

14.1 enable_top_status_line

Synopsis

enable_top_status_line

Usage

Void enable_top_status_line (Integer x);

Description

If x is non-zero, the top status line is enabled. If x is zero, the top status line is disabled and hidden.

See Also

set_top_status_line

14.2 menu_append_item

Synopsis

Append an entry to a menu

Usage

menu_append_item (menu, name, fun [,client_data])

    String_Type menu, name;
    String_Type or Ref_Type fun;
    Any_Type client_data
Description

The menu_append_item function appends a menu item called name to the menu menu. If called with 3 arguments, the third argument must be a string that will get executed or called when the menu item is selected.

When called with 4 arguments, the fun argument may be either a string or a reference to a function. When the item is selected, the function will be called and client_data will be passed to it.

See Also

menu_append_popup

14.3 menu_append_popup

Synopsis

Append a popup menu to a menu

Usage

menu_append_popup (String_Type parent_menu, String_Type popup_name

Description

The menu_append_popup function may be used to append a new popup menu with name popup_name to the menu parent_menu, which may either be another popup menu or a menu bar.

See Also

menu_append_item, menu_append_separator

14.4 menu_append_separator

Synopsis

Append a separator to a menu

Usage

menu_append_separator (String_Type menu)

Description

The menu_append_separator function appends a menu item separator to the menu menu.

See Also

menu_append_item, menu_append_popup

14.5 menu_copy_menu

Synopsis

Copy a menu to another

Usage

menu_copy_menu (String_Type dest, String_Type src)

Description

Then menu_copy_menu function copies the menu item, which may be another popup menu, to another popup menu.

See Also

menu_append_popup, menu_append_item

14.6 menu_create_menu_bar

Synopsis

Create a menu bar

Usage

menu_create_menu_bar (String_Type name)

Description

The menu_create_menu_bar function may be used to create a new menu bar called name. The new menu bar may be associated with a buffer via the menu_use_menu_bar function.

See Also

menu_use_menu_bar, menu_append_popup

14.7 menu_delete_item

Synopsis

Delete a menu item

Usage

menu_delete_item (String_Type name)

Description

The menu_delete_item function deletes the menu called name and all of its submenus.

Example

To delete the System menu from the global menu bar, use

    menu_delete_item ("Global.S&ystem");
See Also

menu_delete_items

14.8 menu_delete_items

Synopsis

Delete the items from a menu

Usage

menu_delete_items (String_Type menu)

Description

The menu_delete_items function deletes all the menu items attached to a specified popup menu. However, unlike the related function menu_delete_item, the popup menu itself will not be removed.

See Also

menu_delete_item, menu_append_popup

14.9 menu_set_init_menubar_callback

Synopsis

Set the initialize menu bar callback

Usage

menu_set_init_menubar_callback (Ref_Type cb)

Description

The menu_set_init_menubar_callback may be used to specify the function that is to be called whenever a menu bar may need to be updated. This may be necessary when the user switches buffers or modes. The callback function must accept a single argument which is the name of the menubar.

See Also

menu_set_select_menubar_callback, menu_create_menu_bar

14.10 menu_set_menu_bar_prefix

Synopsis

Set the prefix string to be displayed on the menu bar

Usage

menu_set_menu_bar_prefix (String_Type menubar, String_Type prefix)

Description

The menu_set_menu_bar_prefix specifies the string that is to be displayed on the specified menu bar. The default prefix is "F10 key ==> ".

See Also

menu_create_menu_bar

14.11 menu_set_object_available

Synopsis

Set the availablity of a menu item

Usage

menu_set_object_available (String_Type menuitem, Int_Type flag)

Description

The menu_set_object_available function may be used to activate or inactivate the specified menu item, depending upon whether flag is non-zero or zero, respectively.

See Also

menu_append_item

14.12 menu_set_select_menubar_callback

Synopsis

Set the function to be called when the menu bar is activated

Usage

menu_set_select_menubar_callback (String_Type menubar, Ref_Type f)

Description

The menu_set_select_menubar_callback function is used to indicate that the function whose reference is f should be called whenever the menu bar is selected. The callback function is called with one argument: the name of the menu bar.

See Also

menu_set_init_menubar_callback, menu_set_select_popup_callback

14.13 menu_set_select_popup_callback

Synopsis

Specify the function to be called prior to a popup

Usage

menu_set_select_popup_callback (String_Type popup, Ref_Type f

Description

The menu_set_select_popup_callback function may be used to specify a function that should be called just before a popup menu is displayed. The callback function must be defined to take a single argument, namely the name of the popup menu.

The basic purpose of this function is to allow the creation of a dynamic popup menu. For this reason, the popup menu will have its items deleted before the callback function is executed.

See Also

menu_set_select_menubar_callback, menu_append_item

14.14 menu_use_menu_bar

Synopsis

Associate a menu bar with the current buffer

Usage

menu_use_menu_bar (String_Type menubar)

Description

The menu_use_menu_bar function may be used to associate a specified menu bar with the current buffer. If no menu bar has been associated with a buffer, the "Global" menu bar will be used.

See Also

menu_create_menu_bar

14.15 set_top_status_line

Synopsis

set_top_status_line

Usage

String set_top_status_line (String str);

Description

This functions sets the string to be displayed at the top of the display. It returns the value of the line that was previously displayed.

See Also

enable_top_status_line


Next Previous Contents