From: Andreas Politz <politza@fh-trier.de>
To: help-gnu-emacs@gnu.org
Subject: Re: widget-create 'menu-choice
Date: Thu, 24 Sep 2009 19:31:41 +0200 [thread overview]
Message-ID: <87hbustfk2.fsf@fh-trier.de> (raw)
In-Reply-To: 86740.76919.qm@web111608.mail.gq1.yahoo.com
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
next prev parent reply other threads:[~2009-09-24 17:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-18 18:54 widget-create 'menu-choice Mortimer Cladwell
2009-09-22 2:28 ` Kevin Rodgers
2009-09-24 17:31 ` Andreas Politz [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-09-24 16:13 Mortimer Cladwell
2009-09-25 2:59 ` Kevin Rodgers
2009-09-26 21:52 Mortimer Cladwell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87hbustfk2.fsf@fh-trier.de \
--to=politza@fh-trier.de \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.