[GRASS5] XDRIVER and hour glass cursor while drawing?

Markus Neteler neteler at itc.it
Thu May 1 09:13:37 EDT 2003


On Thu, May 01, 2003 at 05:08:12AM +0100, Glynn Clements wrote:
> 
> Markus Neteler wrote:
> 
> > > > My question is if it were possible to modify the XDRIVER
> > > > to show a hour glass cursor instead of the common arrow
> > > > when drawing in the GRASS monitor?
> > > > This is already implemented when the user is resizing
> > > > the monitor (redraw event).
> > > 
> > > By "drawing", do you actually mean:
> > > 
> > > a) drawing (i.e. from the point that a drawing command is received to
> > > the time it completes), or
> > 
> > Yes. For example:
> > 
> > GRASS 5.1.0-cvs:~ > time d.vect map=streetmap.shp
> > 
> > real    0m29.497s
> > user    0m12.998s
> > sys     0m3.318s
> 
> d.vect isn't a "drawing command" from the monitor's perspective. 
> d.vect repeatedly calls R_move_abs and R_cont_abs; each R_* function
> is a "drawing command".

Ah, ok. I was describing it from a users perpective.

> > When drawing several vector maps of this type, I wait of course even longer.
> > During the d.vect run the hour glass were great to see to be informed that
> > the drawing is still running (which is less obvious than for raster maps).
> 
> Are you saying that you don't see anything until the command
> completes?

No, I can watch it while the vectors are drawn. But with vector (steets)
maps it's difficult to estimate when it is done if you draw for a large area
and don't know the map well (yet). Raster is drawn top-down, so you know
that it is obviously done when the last line at bottom is drawn.

> > > b) whenever a client is connected but isn't waiting on one of the
> > > R_get_location_with_* functions, or
> > 
> > mhh, less important (for me).
> >  
> > > c) something else?
> > > 
> > > The problem with a) is that many drawing modules actually perform
> > > multiple drawing operations; e.g. rasters are drawn using one command
> > > per source row. There isn't any way for the driver to know where the
> > > larger operation begins and ends. A straightforward implementation
> > > would turn the pointer to an hourglass/clock at the start of each row
> > > and back to the arrow at the end of each row, which might result in a
> > > flickering cursor. This issue doesn't apply to redraw, which has a
> > > definite start and end.
> > 
> > But: while drawing one cannot resize the monitor. For this the draw
> > event is caught. Maybe it could be also used to change the cursor
> > (as it is exactly the same situation)?
> 
> That's basically option b). The monitor cannot be resized while a
> client is connected; it doesn't matter if it's drawing, waiting on
> R_get_location_with_*, or just doing nothing.
> 
> The main reason for not taking that route is that it might result in
> long-running programs displaying the hourglass cursor inappropriately. 
> OTOH, you might be willing to live with that.

You mean live with the latter?

OK, maybe I drop that suggestions, it seems to be too complicated.

Thanks for your comments,

 Markus




More information about the grass-dev mailing list