Package: gtk
Function gtk:menu-shell-bind-model
Lambda Listgtk:menu-shell-bind-model (menushell model namespace separators) ArgumentsDetails
Establishes a binding between a menu shell and a menu model.
The contents of the menu shell are removed and then refilled with menu items
according to the menu model. When the menu model changes, the menu shell is
updated. Calling this function twice on the menu shell with different menu
model will cause the first binding to be replaced with a binding to the new menu model. If the menu model is nil then any previous binding is
undone and all children are removed. The argument separators determines if toplevel items, e.g. sections, have separators inserted between them. This is typically desired for menus but does not make sense for menubars. If the argument namespace is non-nil then the effect is as if all actions mentioned in the model have their names prefixed with the namespace, plus a dot. For example, if the action "quit" is mentioned and namespace is "app" then the effective action name is "app.quit". For most cases you are probably better off using the gtk:menu-new-from-model or gtk:menu-bar-new-from-model functions or just directly passing the g:menu-model object to the gtk:application-app-menu or gtk:application-menubar functions. | See also |
#2023-3-21