Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented dynamic deletion and addition of items to menu
The code works for the current menu data structure and can be applied only to the menubar and its sub-menus (it was tested only for them). So, the value passed to Menu parameter will be one of the top menubar options (file,edit,tool,...). Removing => update_menu(Menu, Item, delete, _) Adding => update_menu(Menu, Item, {append, Pos0, Cmd0}, Help) A sample of use can be found in YafaRay plugin in which it remove the render option in case a valid path to the application was not set: Removing => wings_menu:update_menu(file, {render, ?TAG}, delete); Adding => wings_menu:update_menu(file, {render, ?TAG}, {append, -1, Label}) The value -1 for the append operation means the item will be appended to the end of the menu/sub-menu; Otherwise, the item will be inserted in the specificated position or to the end of the menu if this value is greater than current amount of menu items. NOTE: Added logic that allow the Yafaray - after the engine path be provided - get its render option available under File->Render option whithout need to restart Wings3D. Thanks oort for ask about it.
- Loading branch information