• Advertisement
Sign in to follow this  

making a menu

This topic is 3817 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am making a menu system for OpenGL, but have got to a point where I do not know the best way to continue. I have implemented the Binary Tree abstract data type and it works very well. The idea I have is to have a binary tree for the entire menu structure, and another one which contains only elements which are being displayed at the current time. I am not sure of the best way to do about moving them from one tree to another.

Share this post


Link to post
Share on other sites
Advertisement
I'm not sure what type of menu system you are creating, but it sounds like using a binary tree as an ADT is overly complicated for just a menu system. Without more information about what it is your making the menu for or what it will contain, it is hard to give more help, but here is what I do.

1. Make a struct / class of each menu item that you need
2. Make a linked list of those, one for each.
3. If you have more sub options, just make a header Ptr in the first struct to point to a linked list of submenu options (another defined struct type)

In each of the structs for a menu option you can load all sorts of info for that particular menu option.

Like I said I am in the dark as to what you are doing, so I hope this helps.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement