This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

How to use a variable as widget item?

1 post · 3300 views

I'm trying to create a "dynamic" widget, the following code works fine:
(widget-create 'radio-button-choice
	       :value "One"
	       :notify (lambda (widget &rest ignore)
			 (message "You selected %s"
				  (widget-value widget)))
                '(item "One") '(item "Two") '(item "Three.")  ;; <--- items line
	       )
But I want to replace the items line to something like:
(widget-create 'radio-button-choice
	       :value "One"
	       :notify (lambda (widget &rest ignore)
			 (message "You selected %s"
				  (widget-value widget)))
                (get-widget-items) ;;                                <--- items line
	       )
and compose the items into get-widget-items as a list.

Thanks,
Enrique.