winGRASS + gis.m: Progress bar [was Re: [GRASS-dev] native winGRASS pre-alpha testers needed]

Paul Kelly paul-grass at
Fri May 25 06:53:04 EDT 2007

On Fri, 25 May 2007, Moritz Lennert wrote:

> On 25/05/07 10:44, Moritz Lennert wrote:
>> r.watershed elevation=elevation.dem at PERMANENT threshold=100 basin=basins 
>> stream=streams half.basin=half_basins visual=watershed_vis
> What is strange, however, is that when I run this command from the GUI, a 
> terminal window opens showing the progress percentages in text and not the 
> nice progress bar in the Output window of the GIS Manager.
> Any idea why ?

I'd guess it is because the r.watershed binary is only really a wrapper to 
parse the options and it calls other helper programs to actually do the 
work, and these are the ones that output the progress information. I 
suppose it could be a system()/G_spawn() issue. I guess the spawned 
process needs to inherit the setting that tells it it should output 
progress information in the GUI-compatible format (is there an environment 
variable that tells it that?) and also that stderr of the spawned process 
needs to be going to the same place as that of the original r.watershed 
process so the GUI can pick it up and turn it into a progress bar. 
Probably quite complicated - at least it works at the minute.


More information about the grass-dev mailing list