Posted to tcl by tarwich at Thu Sep 13 16:55:01 GMT 2012view raw
- set DEV "";
-
- proc menu {menuName {args}} {
- package require term::interact::menu;
- package require term::ansi::code::macros;
-
- switch -nocase $menuName {
- MAIN {
- menu run {
- "Build &Options" { menu buildOptions }
- "&Build" { puts "Not implemented!"; }
- "&Quit" {
- puts "User selected Quit. Bye!";
- exit 0;
- }
- }
- }
- BUILDOPTIONS {
- global DEV;
-
- menu run {
- "--DEV-----" {}
- "Developer Folder ($DEV)" {
- global DEV;
- #set candidates [find -type d -maxdepth 2 "{/,/Applications/*/Contents,~}" "Developer"];
- set candidates [list "/Developer" "/Applications/Developer"]
- set DEV [choose -caption "Choose a Dev Root" $candidates];
- updateCaption "Developer Folder ($DEV)";
- }
- }
- }
- RUN { eval runMenu $args; }
- default {
- fail "Menu '$menuName' not implemented";
- }
- }
- }
-
- proc choose {args} {
- # This shows a menu with the list and allows the user to select an item, then returns it
- }
-
- proc runMenu {args} {
- # This is where the menu is output and input is chewed upon
- }
-
- proc updateCaption {args} {}
-
- menu MAIN;
-
- exit 1;
-