3 ms·
Some time in the late '90s a friend and i sat down and tried to design a UI framework that could cover lots of styles. We started with GUI and line-mode termina
by twic 6y ago
Some time in the late '90s a friend and i sat down and tried to design a UI framework that could cover lots of styles. We started with GUI and line-mode terminal, but hoped to add curses and the web (1.0 of course, so using forms, not JavaScript). I didn't know about block-mode terminals at the time.
GUIs and line-mode terminals are radically different, so you have to think of a language of UI primitives that are high-level enough to have a natural implementation in each style.
This is hard! For starters, a GUI is inherently spatial, whereas a command line is more temporal. If you want to specify a sandwich, say, then in a GUI, you might have three select boxes next to each other for the bread, filling, and dressing, and a submit button, whereas on a command line, you need to prompt three times, and perhaps offer options for going back and changing the selection. Or offer internal commands for viewing the lists and making a selection, for a more shell-like interface.
From what i remember, our API ended up looking a lot like web forms - the application presents a series of questions, each with a prompt and a structure for the answer (free text, select one from a list, etc). The GUI implementation then put together a (very ugly) GUI with a elements for each question, the command line implementation asked each question in turn.
We never got as far as trying to display rich information. That could have been a whole different set of problems.
- skissane 6y agoI've seen line-mode apps before provide fill-in forms by giving each field a number, and then you type in the number of the field you want to edit, and then you type in a new value. You want to supply an option to redisplay the whole form on demand. (For an actual hardcopy terminal, you only want to redisplay the whole form when asked, to avoid wasting paper and print time; for a softcopy terminal in line-mode, you can redisplay the whole form much more often.)