[GRASSLIST:6772] Re: tcl-tk or qgis ?

Massimiliano Cannata massimiliano.cannata at supsi.ch
Fri May 13 03:34:40 EDT 2005


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...
Whare can I find good tutorials or guide?
Thanks a lot,
Maxi

Jachym Cepicky wrote:

>On Tue, May 10, 2005 at 11:22:31AM +0200, Massimiliano Cannata wrote:
>  
>
>>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
>>
>>    
>>
>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
>
>  
>
>>Hamish wrote:
>>
>>    
>>
>>>>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"?
>>>>  
>>>>
>>>>        
>>>>
>>>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
>>>http://grass.ibiblio.org/grass60/manuals/html60_user/g.parser.html
>>>for ideas.
>>>
>>>
>>>
>>>Hamish
>>>
>>>
>>>
>>>      
>>>
>>-- 
>>
>>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
>>
>>    
>>
>
>  
>

-- 

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20050513/902ae643/attachment.html


More information about the grass-user mailing list