Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1N0iE4-000731-Hr for mharc-grub-devel@gnu.org; Wed, 21 Oct 2009 16:56:08 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N0iE2-00072e-OK for grub-devel@gnu.org; Wed, 21 Oct 2009 16:56:06 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N0iDx-000711-CN for grub-devel@gnu.org; Wed, 21 Oct 2009 16:56:05 -0400 Received: from [199.232.76.173] (port=48988 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N0iDx-00070u-2k for grub-devel@gnu.org; Wed, 21 Oct 2009 16:56:01 -0400 Received: from mail-fx0-f228.google.com ([209.85.220.228]:63961) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N0iDw-0005KG-J4 for grub-devel@gnu.org; Wed, 21 Oct 2009 16:56:00 -0400 Received: by fxm28 with SMTP id 28so8339056fxm.42 for ; Wed, 21 Oct 2009 13:55:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to :content-type:content-transfer-encoding; bh=orsIByxsajHwX/U/pbtpMKPAJYRe+CCYJqBYhC7XRaU=; b=l49AnnQKEBEbEcxPWUeKDDAbCwNSq5DJKfH7vqIPQXQbMi7eEi7P3tIIs2eTx6iPuc nVroyqyHqWyaM86/go7a7FDGEjEDkVOv9kbWCjMJUd0aAuopMZN0JVtWsz/ZofiA686p T0OMvYb6DyuIdhRb83F7BioMere3Xz55RgklQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :content-transfer-encoding; b=QqdixCSog0uSWa/yeFRY5ugzW22Wc59NMe4odalLfMAWGKroJ8IbLmdaUvg8Ywf3xz E20ml333BTJfbLUQHxuXi8CNt6Yl+kAUNgtULIQI2Pisljw341S6zjLviJLxXPwFhFIq iVEu9Xddt0iBXochrXS/qQQMCCWjTWsAtWJHk= MIME-Version: 1.0 Sender: hramrach@gmail.com Received: by 10.204.3.22 with SMTP id 22mr8639988bkl.181.1256158559124; Wed, 21 Oct 2009 13:55:59 -0700 (PDT) In-Reply-To: References: From: Michal Suchanek Date: Wed, 21 Oct 2009 22:55:39 +0200 X-Google-Sender-Auth: 8e7259e4a0662808 Message-ID: To: The development of GRUB 2 Content-Type: text/plain; charset=UTF-8 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: Wed, 21 Oct 2009 20:56:07 -0000 2009/10/21 Bean : > On Wed, Oct 21, 2009 at 3:31 AM, Michal Suchanek wr= ote: >> 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 { >>> =C3=A1panel { >>> =C3=A1 =C3=A1parameters =3D "text=3Dedit.text" >>> =C3=A1 =C3=A1class =3D frame >>> =C3=A1 =C3=A1width =3D 80% >>> =C3=A1 =C3=A1attach_hcenter =3D 0 >>> =C3=A1 =C3=A1attach_vcenter =3D 0 >>> >>> =C3=A1 =C3=A1edit { >>> =C3=A1 =C3=A1 =C3=A1lines =3D 10 >>> =C3=A1 =C3=A1} >>> =C3=A1} >>> } >> >> 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() { 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" }} } Thanks Michal