On Thu, Oct 22, 2009 at 4:55 AM, Michal Suchanek <hramr...@centrum.cz> wrote: > 2009/10/21 Bean <bean12...@gmail.com>: >> On Wed, Oct 21, 2009 at 3:31 AM, Michal Suchanek <hramr...@centrum.cz> wrote: >>> 2009/10/20 Bean <bean12...@gmail.com>: >>>> 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" }} > } 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 = 100% height = 100% direction = top_to_bottom panel { valign = expand halign = expand text { text = \"$1\" } } panel { halign = expand text { text = \"OK\" }}" } -- Bean gitgrub home: http://github.com/grub/grub/ my fork page: http://github.com/bean123/grub/ _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel