From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mortimer Cladwell Newsgroups: gmane.emacs.help Subject: widget-create 'menu-choice Date: Fri, 18 Sep 2009 11:54:40 -0700 (PDT) Message-ID: <86740.76919.qm@web111608.mail.gq1.yahoo.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1911151278-1253300080=:76919" X-Trace: ger.gmane.org 1253340623 13374 80.91.229.12 (19 Sep 2009 06:10:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 19 Sep 2009 06:10:23 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Sep 19 08:10:15 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mot9C-0005qm-Qg for geh-help-gnu-emacs@m.gmane.org; Sat, 19 Sep 2009 08:10:15 +0200 Original-Received: from localhost ([127.0.0.1]:46424 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mot9C-0001wI-3H for geh-help-gnu-emacs@m.gmane.org; Sat, 19 Sep 2009 02:10:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MoibY-0007q1-6b for help-gnu-emacs@gnu.org; Fri, 18 Sep 2009 14:54:48 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MoibT-0007oF-3Z for help-gnu-emacs@gnu.org; Fri, 18 Sep 2009 14:54:47 -0400 Original-Received: from [199.232.76.173] (port=45934 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MoibS-0007o8-4e for help-gnu-emacs@gnu.org; Fri, 18 Sep 2009 14:54:42 -0400 Original-Received: from n76.bullet.mail.sp1.yahoo.com ([98.136.44.48]:46788) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1MoibR-0001T7-JZ for help-gnu-emacs@gnu.org; Fri, 18 Sep 2009 14:54:41 -0400 Original-Received: from [216.252.122.216] by n76.bullet.mail.sp1.yahoo.com with NNFMP; 18 Sep 2009 18:54:40 -0000 Original-Received: from [67.195.9.81] by t1.bullet.sp1.yahoo.com with NNFMP; 18 Sep 2009 18:54:40 -0000 Original-Received: from [67.195.9.103] by t1.bullet.mail.gq1.yahoo.com with NNFMP; 18 Sep 2009 18:54:40 -0000 Original-Received: from [127.0.0.1] by omp107.mail.gq1.yahoo.com with NNFMP; 18 Sep 2009 18:54:40 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 182869.29401.bm@omp107.mail.gq1.yahoo.com Original-Received: (qmail 81086 invoked by uid 60001); 18 Sep 2009 18:54:40 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1253300080; bh=lQxla0DvoBlIqhktOGpepTjoCX9ryg9M9nQmFQJCR64=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=n0gLKf8ZiGkoAS+eNyB2ASGR0UnJDbQIinZqQyQboSWP0jorqtBvyunkT/IU49y7stSE9GfOix8Ui1T+Myt4gYcF7YPcMDBnZxXiAWwFam6Qk/61I1JX3vWAPlu2t84V1keikWlYUWDBJK1haDiKtCp1hCoEGfx57282pYfRs0I= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=b5hKsz2E7pFoxTy+8V2EFpVy0Sek9iOzTI/OO1fYgTBCAYAjByeX6kGpqiX6Vgxc3y45wDPxlwIhKzRaA6PsJ9ulogtFMyd3jTJT6nunBIqzhrnHcrFCYtwPrv8zoID2aG1pNBoFD77lElB4exzrL3uH3/kZLL2UNOcE/VNq6oI=; X-YMail-OSG: iJ.duOQVM1kaCdhWm7QXCT5g9IQ7npoCOjdcRkBtAIPF6x5gTS1JkvtsFkPnJ6aNm_N5E9.tAQD7jyTPprd00Vf_3r2HGFVR7c7jZ.UWbk0ZRmI1dWkNVwt7fZtylgtcLj1l1RRPu5il3uYYk2q4KlKU2g5nUZZ6KEZd6y4.YToze5l5NI7.et4T3Aur4O4NUu94ps4jhagZvaWyI4g- Original-Received: from [155.94.110.223] by web111608.mail.gq1.yahoo.com via HTTP; Fri, 18 Sep 2009 11:54:40 PDT X-Mailer: YahooMailRC/157.18 YahooMailWebService/0.7.347.2 X-detected-operating-system: by monty-python.gnu.org: FreeBSD 6.x (1) X-Mailman-Approved-At: Sat, 19 Sep 2009 02:06:59 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:68299 Archived-At: --0-1911151278-1253300080=:76919 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi,=0A=0AI would like to dynamically populate a dropdown widget from a data= base.=A0 the 'menu-choice widget looks like=0A=0A(widget-create 'menu-choic= e=0A=A0=A0=A0=A0 =A0=A0 :tag "Select Host Species"=0A=A0=A0=A0=A0 =A0=A0 :v= alue "unknown"=0A=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 :notify (= lambda (widget &rest ignore)=0A=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (setq host-species (widget-value widge= t)))=0A=A0=A0=A0 '(item "human") =0A=A0=A0=A0 '(item "rat") =0A=A0=A0=A0 '(= item "mouse")) =0A=0ASuppose I can generate a list '( "human "rat" "mouse")= from the database.=A0 How to create=0A=0A=A0=A0 '(item "human") =0A=A0=A0= =A0 '(item "rat") =0A=A0=A0=A0 '(item "mouse")=0A=0Aon the fly?=A0 The clos= est I can come is =0A=0A(progn=0A=A0 (setq var '( "human" "rat" "mouse"))= =0A(mapcar '(lambda=A0 (a)=A0 `'(item ,a))=A0 var)=0A)=0A=0AThanks=0A=0AMor= timer=0A=0A=0A --0-1911151278-1253300080=:76919 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,
=0A
 
=0A
I would like to d= ynamically populate a dropdown widget from a database.  the 'menu-choi= ce widget looks like
=0A
 
=0A
(widget-create 'menu-= choice
        :tag "Select Host Species"<= BR>        :value "unknown"
  &n= bsp;            = ;  :notify (lambda (widget &rest ignore)
   &nbs= p;            &= nbsp;          (setq host-spec= ies (widget-value widget)))
    '(item "human")
=0A=
    '(item "rat")
=0A
    '(it= em "mouse"))
=0A
Suppose I can generate a list '( "human "rat= " "mouse") from the database.  How to create
=0A
 
= =0A
   '(item "human") =0A
    '(item "rat= ")
=0A
    '(item "mouse")
=0A
 =0A
on the fly?  The closest I can come is
=0A
 <= /DIV>=0A
(progn
  (setq var '( "human" "rat" "mouse"))
=0A=
(mapcar '(lambda  (a)  `'(item ,a))  var)
=0A
= )
=0A
Thanks
=0A
 
=0A
Mortimer

=0A=0A --0-1911151278-1253300080=:76919--