Package: gtk

Function gtk:radio-menu-item-join-group

Lambda List

gtk:radio-menu-item-join-group (item group)

Arguments

item -- a gtk:radio-menu-item widget
group -- a gtk:radio-menu-item widget whose group we are joining, or nil to remove item from its current group

Details

Joins a radio menu item to the group of another radio menu item. This function should be used by language bindings to avoid the memory manangement of the opaque g:slist-t structure of the gtk:radio-menu-item-get-group and gtk:radio-menu-item-set-group functions.

Examples

A common way to set up a group of radio menu item instances is:
(let (item lastitem)
  ;; Add three menu items to a group
  (dolist (label '("First Menu Item" "Second Menu Item" "Third Menu Item"))
    (setf item (gtk:radio-menu-item-new-with-label nil label))
    (gtk:radio-menu-item-join-group item lastitem)
    (setf lastitem item)))    
 

See also

2023-3-13