How to use a variable as widget item?

Discussion of Emacs Lisp

How to use a variable as widget item?

Postby hyperborean » Tue Dec 21, 2010 10:15 am

I'm trying to create a "dynamic" widget, the following code works fine:

Code: Select all
(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:

Code: Select all
(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.
hyperborean
 
Posts: 1
Joined: Tue Dec 21, 2010 10:06 am

Return to Emacs Lisp

Who is online

Users browsing this forum: No registered users and 3 guests