Ruby TUI

I’m creating a program with a TUI to then later implement a GUI using TK
but for now I’m having trouble coming up with a menu system that works
without a whole lot of loops and calls, which is what I have now but its
starting to get really messy and confusing, any suggestions. Somthing
along the lines of this:

Root Menu
|-Option1
| |-subOption1
| |-subOption2
|
|-Option2
|-Exit

main_menu.call #gets and returns menu_option
case menu_option
when ‘1’
list_pos.call
main_menu.call
when ‘2’
lookup_menu.call
case menu_option
when ‘1’ then list_pos.call
when ‘B’ then main_menu.call
else $aMenu.error
end

end

On 7/26/06, Ryan Edwards-crewe [email protected] wrote:

I’m creating a program with a TUI to then later implement a GUI using TK
but for now I’m having trouble coming up with a menu system that works
without a whole lot of loops and calls, which is what I have now but its
starting to get really messy and confusing, any suggestions. Somthing
along the lines of this:

Check out the ‘highline’ gem - its designed to help build “high level
line-oriented” interfaces - and has direct support for menus.

http://rubyforge.org/projects/highline/

Justin

Justin

Thanks,

Crewe

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs