C Programming help .....
Roger Oberholtzer
roger
Tue Jan 25 13:25:06 PST 2005
On Tue, 2005-01-25 at 11:02 -0600, Ben Duncan wrote:
> yes and no and no and yes ... <LAFF> .. in this case it was a test program
> I am playing with to get familiar with dealing with structures and sub-structs
> and arrays and arrays of structures and structures of arrays. This is part
> of the on-going effort I am doing for my SLAG project.
>
> In particular, this is the master menuing sub-system. It will read off disk,
> the menu definitions and build menu sets, currently defined as an array
> of 64. The menu set consists of 20 line items max and a line item
> is a structure (line id, description, line type and program name).
>
> Then, you have to track a "user" list of menu and drill down menu's
> that are open. And to top it off, a menu line item can be type "menu"
> that is another menu set, so you can literally have recursive menuing
> going on.
You need a linked list. Then you can add/delete/move/generally fiddle
with menus and menu items in a very painless way. It also means they can
very easily be dynamically allocated and thus not have any nasty
compiled-in limits. Even though you are doing this in C, it could be
instructive to look at the Tcl/Tk 'menu' command. It is a good example
of how to define a menu and menus of menus. JMTCW.
--
Roger Oberholtzer <roger at opq.se>
More information about the Linux-users
mailing list