help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

widget-create 'menu-choice


From: Mortimer Cladwell
Subject: widget-create 'menu-choice
Date: Fri, 18 Sep 2009 11:54:40 -0700 (PDT)

Hi,
 
I would like to dynamically populate a dropdown widget from a database.  the 'menu-choice widget looks like
 
(widget-create 'menu-choice
        :tag "Select Host Species"
        :value "unknown"
                 :notify (lambda (widget &rest ignore)
                           (setq host-species (widget-value widget)))
    '(item "human")
    '(item "rat")
    '(item "mouse"))
Suppose I can generate a list '( "human "rat" "mouse") from the database.  How to create
 
   '(item "human")
    '(item "rat")
    '(item "mouse")
 
on the fly?  The closest I can come is
 
(progn
  (setq var '( "human" "rat" "mouse"))
(mapcar '(lambda  (a)  `'(item ,a))  var)
)
Thanks
 
Mortimer


reply via email to

[Prev in Thread] Current Thread [Next in Thread]