<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<DEFANGED_meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-2">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Yes, I've seen how to build a tkltkgrass command windows, but my
question is how to costumize it? It seems to be a standard windows
(serch button, run, cancel, quit....etc.) but how to make a more
interactive windows, let say like d.m? with buttons to call commands
etc..... how to handle with passing variables between windows, etc...<br>
Whare can I find good tutorials or guide?<br>
Thanks a lot,<br>
Maxi<br>
<br>
Jachym Cepicky wrote:<br>
<blockquote type="cite" cite="mid20050511120001.GE3962@trava">
<pre wrap="">On Tue, May 10, 2005 at 11:22:31AM +0200, Massimiliano Cannata wrote:
</pre>
<blockquote type="cite">
<pre wrap="">That's what I've done,
I have develoop some new command, and now I have a shell script that
call in the rigth order a numbers of function and generates maps....
I have some input needed and of course can be simply asked to the user
by using g.parser....
But what I'd like to do is an hydrologic window menu....
I try to better explain me:
1) a windows with 3 options (button) for preprocessing, calibration,
simulation. Each one opens a new window.
2) in each windows input box and associated button....
for instance I will have a preprocessing window:
input elevation map: (text box) - select (button)
input river map name : (text box) - select (button) - extract (button)
if I press the extract button a new windows for river extraction will be
opened.
It will get the already entered elevation maps and a new user entered
treshold value.
With a run button calculate and display the map.
With a save button return to the preprocessing window with the input
river map text box filled with the calculated map.
As I'm new to GUI programming, how to get somethink like this (obviously
integrated in GRASS )?
tcltkgrass?
qgis?
other?
Thanks,
Maxi
</pre>
</blockquote>
<pre wrap=""><!---->example of the C code for GRASS (see r.example):
        /* Define the different options */
        input = G_define_option() ;
        input->key = "input";
        input->type = TYPE_STRING;
        input->required = YES;
        input->description= ("Name of an input layer" );
        output = G_define_option() ;
        output->key = "output";
        output->type = TYPE_STRING;
        output->required = YES;
        output->description= ("Name of an output layer");
        /* Define the different flags */
        flag1 = G_define_flag() ;
        flag1->key = 'q' ;
        flag1->description = "Quiet" ;
example of the shell-code (see manual to g.parser):
#%flag
#% key: f
#% description: a flag
#%END
#%option
#% key: raster
#% type: string
#% gisprompt: old,cell,raster
#% description: raster input map
#% required : yes
#%end
#%option
#% key: vector
#% type: string
#% gisprompt: old,vector,vector
#% description: vector input map
#% required : yes
#%end
if [ "$1" != "@ARGS_PARSED@" ] ; then
exec $GISBASE/etc/bin/cmd/g.parser "$0" "$@"
fi
that's all folks!
Jáchym
</pre>
<blockquote type="cite">
<pre wrap="">Hamish wrote:
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">I'd like to program an interface to handle preprocessing, calibration
and simulation of a GRASS based hydrological model.
I have seen that the new interface could be a qgis interface, so my
question is where I have to focus on? "Tcltkgrass" or "qgis grass
toolbox"?
</pre>
</blockquote>
<pre wrap="">I would write a shell script using the GRASS's g.parser[*]. Adding that
to the GUI in GRASS or in QGIS would be easy to do - just keep the logic
out of the GUI, use it as a front-end.
[*] see the included GRASS 6 scripts/ in the source distribution and
<a class="moz-txt-link-freetext" href="http://grass.ibiblio.org/grass60/manuals/html60_user/g.parser.html">http://grass.ibiblio.org/grass60/manuals/html60_user/g.parser.html</a>
for ideas.
Hamish
</pre>
</blockquote>
<pre wrap="">--
Eng. Massimiliano Cannata
Scuola Universitaria Professionale della Svizzera Italiana
Istituto Scienze della Terra
Via Trevano, c.p. 72
CH-6952 Canobbio-Lugano
Tel: +41 (0)58 666 62 18
Fax +41 (0)58 666 62 09
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Eng. Massimiliano Cannata
Scuola Universitaria Professionale della Svizzera Italiana
Istituto Scienze della Terra
Via Trevano, c.p. 72
CH-6952 Canobbio-Lugano
Tel: +41 (0)58 666 62 18
Fax +41 (0)58 666 62 09
</pre>
</body>
</html>