Blitz3D+ Command Reference

SetMenuText menu,text$

Parameters

menu - menu item handle

text$ - new label; an & marks the accelerator letter

Description

Changes the label of a menu item.

Requires Extended language mode.

Menus stay honest when their labels track the program's state: "Pause"/"Resume", "Undo Move Entity", or a recent-files list rewritten after each load. The label is UTF-8, and an & in front of a letter makes it the Alt accelerator, as in "&File".

The change edits the logical menu immediately, but a window's menu bar only redraws when you call UpdateWindowMenu - batch your menu edits, then call it once. Popup menus need nothing extra: ShowPopupMenu rebuilds them fresh every time. Setting the same text again is a no-op, so nothing gets marked for a redraw.

Gotcha: an empty label is how separators are represented, so setting a real item's text to "" turns it into a separator line when the menu is next rebuilt.

See also: MenuText, CreateMenu, UpdateWindowMenu, CheckMenu, EnableMenu.

Index