Dear developers,
I use Perl for writing simple scripts for GRASS. Now I desided to write my own
perl-module (grass.pm), which should simplify the code writing. It generates
the help message and loads all required commandline options.
According to GRASS-Bash scripts, it would be good, if GRASS could generate the
Tk-GUI `on the fly' for the Perl (Python, ...) scripts too.
But how to do it? What procedure should one call and how?
I'm sending the module below and I'm hoping, it could be usefull.
Thank you for hints
Jáchym
--
Jachym Cepicky
e-mail: jachym.cepicky@centrum.cz
URL: http://les-ejk.cz
GPG: http://www.fle.czu.cz/~jachym/gnupg_public_key/
(attachments)
grass.29093DEFANGED-pm (6.04 KB)
Jachym Cepicky wrote:
I use Perl for writing simple scripts for GRASS. Now I desided to write my own
perl-module (grass.pm), which should simplify the code writing. It generates
the help message and loads all required commandline options.
According to GRASS-Bash scripts, it would be good, if GRASS could generate the
Tk-GUI `on the fly' for the Perl (Python, ...) scripts too.
But how to do it? What procedure should one call and how?
I'm sending the module below and I'm hoping, it could be usefull.
Thank you for hints
To process command-line options, you should use the g.parser program.
Whilst it was originally intended for use in shell scripts, it should
be usable from any language which uses the '#' character for comments.
Regarding the GUI dialogs: you can run the program with the --ui flag.
This will cause the program to generate and display the dialog, then
re-execute itself with the chosen options.
--
Glynn Clements <glynn@gclements.plus.com>