# Ruby TUI

**URL:** <https://www.ruby-forum.com/t/ruby-tui/100011>\
**Category:** Ruby\
**Created:** [July 26, 2006, 6:38pm UTC](https://www.ruby-forum.com/t/ruby-tui/100011 "2006-07-26T18:38:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![diragor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/6a8cbe/32.png) [@diragor](https://www.ruby-forum.com/u/diragor)\
**Post date:** [July 26, 2006, 6:38pm UTC](https://www.ruby-forum.com/t/ruby-tui/100011/1 "2006-07-26T18:38:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![diragor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/6a8cbe/32.png) [@diragor](https://www.ruby-forum.com/u/diragor)\
**Post date:** [July 26, 2006, 7:14pm UTC](https://www.ruby-forum.com/t/ruby-tui/100011/2 "2006-07-26T19:14:33Z")

</div>

On 7/26/06, Ryan Edwards-crewe [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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/](http://rubyforge.org/projects/highline/)

Justin

---

<div class="post-metadata">

**Author:** ![diragor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/6a8cbe/32.png) [@diragor](https://www.ruby-forum.com/u/diragor)\
**Post date:** [July 27, 2006, 2:53am UTC](https://www.ruby-forum.com/t/ruby-tui/100011/3 "2006-07-27T02:53:58Z")

</div>

> Justin

Thanks,

Crewe
