grub-devel
[Top][All Lists]
Advanced

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

Re: [GITGRUB] New menu interface (implementation)


From: Michal Suchanek
Subject: Re: [GITGRUB] New menu interface (implementation)
Date: Wed, 21 Oct 2009 22:55:39 +0200

2009/10/21 Bean <address@hidden>:
> On Wed, Oct 21, 2009 at 3:31 AM, Michal Suchanek <address@hidden> wrote:
>> 2009/10/20 Bean <address@hidden>:
>>> Hi,
>>>
>>> Update:
>>>
>>> Add dialog support, it allows you to write a template and call it with
>>> different parameters, for example:
>>>
>>> dialog_edit {
>>> ápanel {
>>> á áparameters = "text=edit.text"
>>> á áclass = frame
>>> á áwidth = 80%
>>> á áattach_hcenter = 0
>>> á áattach_vcenter = 0
>>>
>>> á áedit {
>>> á á álines = 10
>>> á á}
>>> á}
>>> }
>>
>> 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=100% height=100% }"
>
> 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 = 100% ; height = 100% ; direction = top_to_bottom
  panel { valign = expand ; halign = expand ; text { text = "$1" } }
  panel { halign = expand ; text { text = "OK" }}
 }


Thanks

Michal




reply via email to

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