[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] GUI Idea (semi-off-topic)



At 16:52 -0700 98/05/12, Craig Muth wrote:
>    The following is a description of an idea I have thrown together for
>the purpose of enabling one to create simple GUI's very quickly.  I have

<snip>

>    This would be displayed to the user as a GUI window that would look
>the same as the above, except that [] would be a text field, '-' would
>be a checkbox, and (Cancel) and (OK) would be buttons.  After it was

While I understand the rationale, I would tend to prefer [] for check boxes and
() for radio buttons (with something, say X or * inside the brackets if
"clicked".  I'd probably be more likely to quote strings...


Once upon a time, long long ago, the A/UX project wrote a description language
for generating Commando dialogs (for non-MPW users, these are the GUI dialogs
that allow a user to access the various MPW commands with all of their
arguments and options if they can't remember anything more than the name of the
command). Unlike MPW, which had about 2 dozen hand-crafted dialogs, we needed
one for each of the 500 A/UX (Unix) commands so we had to automate the process.

One of the programmers wrote a lexer, and we created a dialog-description
language. The lexer read the "dialog scripts" and turned them into Commando
dialogs with real radio buttons, etc.  I've often considered recapitulating the
lexer (lost in the shuffle; i.e. I didn't write it and never snagged a copy) in
Perl. An example of a dialog script:

command name "rm"
help "Remove files or directories."
row {
    column {
        column {
        name "Remove"
            radio buttons {
                option name "Files only"
                    prefix ""
                    help "By default, only files are removed."
                option name "Directories and contents"
                   prefix "-r"
                   help "[-r] Recursively delete the directory"
                   enables "Choose directories to remove"
            }
        }
        column {}
        option name "Force file removal"
            prefix "-f"
            help "[-f] Do not print error messages or ask questions"
        option name "Interactive mode"
            prefix "-i"
            help "[-i] Ask whether or not to delete each file"
    }
    column {
        column {}
        option name "Choose file(s) to remove"
            prefix ""
            help "Choose one or more files to remove."
            filelist
        option name "Choose directories to remove"
            prefix ""
            help "Choose one or more directories to remove."
            dirlist
        option name "Output"
            outpopup
        option name "Error"
            errpopup
    }
}
---
Vicki Brown, vlb@cfcl.com        |\      _,,,---,,_
Journeyman Sourceror      ZZZzz /,`.-'`'    -.  ;-;;,_
Scripts & Philtres             |,4-  ) )-,_. ,\ (  `'-'
http://www.cfcl.com/~vlb      '---''(_/--'  `-'\_)
P.O. Box 1269 San Bruno, CA  94066

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch