[syslinux] How to define the main menu style

Murali (முரளி கணபதி) murali at google.com
Tue Feb 17 11:11:11 PST 2009


On Tue, Feb 17, 2009 at 11:00 AM, Murali (முரளி கணபதி)
<murali at google.com> wrote:
> On Tue, Feb 17, 2009 at 5:32 AM, Erwan Velu <erwan at seanodes.com> wrote:
>> Murali (முரளி கணபதி) wrote:
>>> On Fri, Feb 13, 2009 at 6:01 AM, Erwan <erwan at seanodes.com> wrote:
>>>
>>>> Hey Murali,
>>>>
>>>> I'm currently playing with the menu system (against latest git).That's a
>>>> very nice toy you gave us, thanks ;o)
>>>>
>>>> I was just wondering if it's possible to put the main menu as a single line
>>>> on top of the screen instead of having a big box on the top left on the
>>>> screen.
>>>> Having a single line a the top would leave me a lot of space for the sub
>>>> menu.
>>>>
>>>
>>> You want the top level menu to be horizontal instead of vertical! The
>>> menu rendering code only renders vertically now. You could add a
>>> boolean field to the menu data structure and modify the rendering code
>>> appropriately. I would guess no more than 20-30 line code change.
>>>
>>>
>> Hey Murali,
>> I don't know that much the menu code, could you provide me some hints to
>> achieve that task ?
>>
>
> Glad the code is being used.
>
> * menu/libmenu/menu.h contains the declaration of the menu structure
> (struct s_menu). You would need to add a boolean (vertical/horiz) and
> possibly some more params related to horizontal rendering.
>
> * menu/libmenu/menu.c contains the actual rendering code. The
> following functions would need to be modified
>  + printmenu
>     Need to handle horiz rendering
>  + printradiomenu
>     I wouldn't bother with changing this assuming you dont want a
> radio box rendered horiz.
>     Could probably just enforce that radiomenu's are always vertical.
>  + clearmenu (to clean up horiz menu also)
>  + getmenuoption
>     Depending on horiz/vertical rendering UP/DOWN and RIGHT/LEFT keys
> should have different action.
>
> * The entry point for the code is showmenus() function which does some
> setup and calls runmenusystem() which does all the work.
>
> For testing, we should also ensure that it does the right thing if a
> non-top level menu is horizontal.
>
> Feel free to email if you have other questions.
>

Oh. You also need to change add_menu / add_named_menu functions so you
can actually create a horizontal menu :-) It is probably better to
leave them be and add "add_horiz_menu" and "add_horiz_named_menu"
functions, so existing users are not affected, unless C now has
default arguments/overloading (which is not true when I last checked).


-- 
Murali

கற்றது கை மண் அளவு, கல்லாதது உலகளவு
(What we know is only a handful, what we dont is the rest of the world)




More information about the Syslinux mailing list