Prev: Postgres
Next: Tcl_AsyncCreate and Wish
From: RickE on 11 Jan 2010 12:54 On Jan 9, 12:43 pm, prefect <adr...(a)wallaschek.de> wrote: > I need to create a textmode client that should have menu and > dialogues. > > So far I consider two possible solutions none of them is TCL: > > Either, I use the Linux dialog tool via exec calls. This has certain > limitation but is very easy to configure. > > Alternatively I use a dinosaur: Clipper in person of harbour. Harbour > (like Clipper derived from good old dBase) has a very nice UI far > ahead of its time ;-)). Regrettably to my knowledge TCL never got that > far?! > The idea with harbour is mad: create a little source to implement a > dialogue on the fly compile that and execute it. So the exec would not > need parameters, all is coded into the source, while the output might > go into a file to be sources or otherwise loaded. > > No the simple question is: > > Is there any more elegant solution e.g. based on curses or so? > > I'd love to hear something like this! Very interesting. NCurses is OK, but if you can directly use escape codes you are way ahead. That depends on what escape codes your terminal uses. The Linux terminal emulator escape codes described in the console_codes man page are mostly based on the VT100 terminal. NCurses uses the terminfo database to map C library functions to escape codes from your TERM environment variable. I am also very interested in embedded appliances and serial port termios interfacing. Most microcontrollers have a UART like interface and can do real time work. I've done some FreePascal work and posted a demo and Linux console code unit there. But TCL shell control is ideal. Variables can be played with on the fly. Thanks for the post. RE
From: Elchonon Edelson on 11 Jan 2010 14:40
RickE wrote: > > NCurses is OK, but if you can directly use escape codes you are way > ahead. That depends on what escape codes your terminal uses. The Linux > terminal emulator escape codes described in the console_codes man page > are mostly based on the VT100 terminal. NCurses uses the terminfo > database to map C library functions to escape codes from your TERM > environment variable. > > I am also very interested in embedded appliances and serial port > termios interfacing. Most microcontrollers have a UART like interface > and can do real time work. I've done some FreePascal work and posted a > demo and Linux console code unit there. > > But TCL shell control is ideal. Variables can be played with on the > fly. > > Thanks for the post. > RE Since you mentioned terminfo, let me mention the 'tput' command. The tput command should be available on any UNIX or UNIX-like system, and allows you a measure of abstraction away from using direct escape sequences for terminal control. See 'man tput' and 'man 4 terminfo' (depending on what kind of UNIX you have, that might need to be 'man -s 4 terminfo') for more information. Also see, for example, http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x405.html and http://www.ibm.com/developerworks/aix/library/au-learningtput/index.html -Edelson -- It used to be said that AIX looks like one space alien discovered Unix, and described it to another different space alien who then implemented AIX. But their universal translators were broken and they'd had to gesture a lot. -- Paul Tomblin |