[GRASS-dev] GUI platforms

Glynn Clements glynn at gclements.plus.com
Tue May 23 03:50:29 EDT 2006


Michael Barton wrote:

> > Do you envision something that would be a plugin replacement for
> > g.parser that would possibly allow for more interactive dialogues, but
> > would allow existing modules to work without modification. If so I
> > think this would be ideal, but not being familiar with that code I
> > don't know what is possible.
> 
> I'm talking about functionality at a conceptual level, not implementation.
> How to do this might vary depending on the platform chosen. Since (I think)
> g.parser is specific to TclTk, a new version would need to be written that
> is not--either in the GUI platform or in GRASS functions/libraries.

"g.parser" isn't specific to Tcl/Tk. G_parser() includes functionality
to output a description of the command-line options in Tcl/Tk syntax.
This can still be used by a non-Tcl/Tk GUI in one of two ways:

1. Use the --ui switch, which spawns "wish" and feeds the Tcl/Tk code
to it (gis.m uses the --tcltk switch, which just writes the Tcl/Tk
code to stdout).

2. Parse the Tcl/Tk code. The generated code is extremely restricted
in its form, and could easily be parsed by a C program.

Alternatively, a C module could use the XML generated by the
--interface-description switch. Or G_parser() could easily be extended
to generate a different format (e.g. XML usable by the Glade library).

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list