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

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

Re: widget-create 'menu-choice


From: Andreas Politz
Subject: Re: widget-create 'menu-choice
Date: Thu, 24 Sep 2009 19:31:41 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Mortimer Cladwell <mbcladwell@yahoo.com> writes:

> 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

`apply' solves this problem.

(apply #'* 1 2 3 '(4 5))

-ap





reply via email to

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