UpdateWindowMenu window
Parameters
| window - window whose menu bar should be rebuilt |
Description
|
Rebuilds and redraws a window's menu bar after you have changed its menus. Requires Extended language mode. Menu items live in Blitz until you say otherwise: CreateMenu, SetMenuText, CheckMenu, UncheckMenu, EnableMenu and DisableMenu all change the item tree, and UpdateWindowMenu is the one call that pushes the whole tree back into the native bar. Build your File and View menus, call it once, and the bar appears; toggle a Show grid check mark later and call it again so the mark shows up. It is cheap to call and safe to over-call. The window tracks whether anything actually changed, so an update after a no-op change (checking an item that was already checked) does nothing at all - no rebuild, no flicker. Rebuilding also re-runs the window's client layout, because gaining or losing a row of menu headings changes the client height your gadgets sit in. Two things to watch. The window needs a menu bar to update: style bit 4 on CreateWindow, which the default style 15 includes - on a window created without it the call quietly does nothing. And popup menus made with CreatePopupMenu never need this call, because their native menu is built fresh every time ShowPopupMenu displays it. See it working in the menus and events sample and the world editor shell sample. See also: WindowMenu, CreateMenu, CheckMenu, EnableMenu, SetMenuText, CreateWindow. |
Index