-(defun create-radio-button-group (specs active &optional callback &rest args)
- (let ((group nil)
- (i 0))
- (mapcar
- #'(lambda (spec)
- (destructuring-bind
- (label &optional object &rest initargs) (mklist spec)
- (let ((button
- (apply
- #'make-instance 'radio-button
- :label label :visible t initargs)))
- (when group (%radio-button-set-group button group))
- (setq group (%radio-button-get-group button))
- (cond
- (callback
- (signal-connect
- button 'toggled
- #'(lambda ()
- (when (toggle-button-active-p button)
- (apply (funcallable callback) object args)))))
- (object
- (signal-connect
- button 'toggled
- #'(lambda ()
- (apply
- (funcallable object)
- (toggle-button-active-p button) args)))))
- (when (= i active)
- (setf (toggle-button-active-p button) t))
- (incf i)
- button)))
- specs)))
-
-