From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1N0ody-00047H-Ly for mharc-grub-devel@gnu.org; Wed, 21 Oct 2009 23:47:18 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N0odw-00043k-TC for grub-devel@gnu.org; Wed, 21 Oct 2009 23:47:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N0ods-0003ta-6E for grub-devel@gnu.org; Wed, 21 Oct 2009 23:47:16 -0400 Received: from [199.232.76.173] (port=39388 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N0odr-0003sy-Sn for grub-devel@gnu.org; Wed, 21 Oct 2009 23:47:11 -0400 Received: from mail-pz0-f181.google.com ([209.85.222.181]:52666) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N0odr-0000va-5z for grub-devel@gnu.org; Wed, 21 Oct 2009 23:47:11 -0400 Received: by pzk11 with SMTP id 11so5219670pzk.14 for ; Wed, 21 Oct 2009 20:47:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=p5V+jLazaWOZh+X8Xdv6YlO+0ehW7X8je8E2vZA+qrw=; b=lqfqzqH8+fEt/YIwcF6cZyg4pXSxWFnbR5wUswfTAYIs0YXeXQ6rBAWzxiyTKHDVav V+dS+QOtBxo3rPpkmP8t+R91R8kIuktzJr/XHEC71DSKdHK7vCCOF7QUIcutF2icvnWi HM0fz9liW8LL+/czANETxCAa26C67fNr9k2sU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=tS5CTNSQvxJWT/98oP4mO4aipn+Qh2JW9UHTfZwiQDNv71K798JFnahF+LFtMMjio9 tAnWqI11BNcU4nETtXzKgB40mcP9Mb6+8U1fClzqR9O1zeg4BtmgHFiPOTE0srWObzXB Y5vmBuxE4KfxHO+KQ5KvlA2Qj1NW7tcrJWQXU= MIME-Version: 1.0 Received: by 10.140.208.15 with SMTP id f15mr1715362rvg.49.1256183228069; Wed, 21 Oct 2009 20:47:08 -0700 (PDT) In-Reply-To: References: Date: Thu, 22 Oct 2009 11:47:07 +0800 Message-ID: From: Bean To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [GITGRUB] New menu interface (implementation) X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2009 03:47:17 -0000 On Thu, Oct 22, 2009 at 4:55 AM, Michal Suchanek wrot= e: > 2009/10/21 Bean : >> On Wed, Oct 21, 2009 at 3:31 AM, Michal Suchanek w= rote: >>> 2009/10/20 Bean : >>>> Hi, >>>> >>>> Update: >>>> >>>> Add dialog support, it allows you to write a template and call it with >>>> different parameters, for example: >>>> >>>> dialog_edit { >>>> =E1panel { >>>> =E1 =E1parameters =3D "text=3Dedit.text" >>>> =E1 =E1class =3D frame >>>> =E1 =E1width =3D 80% >>>> =E1 =E1attach_hcenter =3D 0 >>>> =E1 =E1attach_vcenter =3D 0 >>>> >>>> =E1 =E1edit { >>>> =E1 =E1 =E1lines =3D 10 >>>> =E1 =E1} >>>> =E1} >>>> } >>> >>> I can see this used for the edit boxen and text mesasge dialogs which >>> would be quite similar. >>> >>> Also the templating seems quite flexible and versatile. >>> >>> However, can't this be done with a shell function? >>> >>> Both the grub.d scripts and grub.cfg can define a function with a few >>> parameters to achieve pretty much the same results. >>> >>> IIRC one of the sample menu.cfg files defined functions as part of >>> grub configuration so we do not need another facility for this. >>> >> >> Hi, >> >> IMO it's more easy to write widget this way, you can still pack it in >> shell script as menu_popup support string argument: >> >> menu_popup -s "panel { width=3D100% height=3D100% }" >> >> This is fine for short code, but as the widget become more complex, >> it's quite difficult to use this notion, especially when you add >> command property which requires quotes. There seems to be some issue >> with embedded quote handling. >> > > Perhaps the notation is broken. > > Why do you need the quotes there? The panel should be delimited by its {}= . > > Then you can write > popup_text() { >=A0menu_popup -s panel { width =3D 100% ; height =3D 100% ; direction =3D = top_to_bottom >=A0panel { valign =3D expand ; halign =3D expand ; text { text =3D "$1" } = } > =A0panel { halign =3D expand ; text { text =3D "OK" }} >=A0} Hi, The above syntax is not accepted by sh parser, you have to enclose the widget description it in strings: popup_text() { menu_popup -s "panel { width =3D 100% height =3D 100% direction =3D top_to_bottom panel { valign =3D expand halign =3D expand text { text =3D \"$1\" } } panel { halign =3D expand text { text =3D \"OK\" }}" } --=20 Bean gitgrub home: http://github.com/grub/grub/ my fork page: http://github.com/bean123/grub/