[GRASSLIST:9278] make G_plot_line() persistant in monitor

Greetings,

lots of questions today....

I am writing a new module that draws to the active monitor using the function
G_plot_line (x, y, x+dx, y+dy);

The line is drawn, but it is not persistant on the screen- in the way that the
output from something like d.grid would be. Poking around in the source code
for d.vect.thematic I found the following code, that *appears* to make the
lines persistant on the screen... but I am not sure how to interpret these
functions:
-----------------from d.vect.chart ------------------------
if(ret == 0) {
  D_add_to_list(G_recreate_command()) ;
        D_set_dig_name(G_fully_qualified_name(map_opt->answer, mapset));
        D_add_to_dig_list(G_fully_qualified_name(map_opt->answer, mapset));
-----------------------------------------------------------------

inserting D_add_to_list(G_recreate_command()) into my new module seems to
make the line persistant, but why?

Any pointers, or places to look for some more information on this?

Many Thanks!

--
Dylan Beaudette
Soils and Biogeochemistry Graduate Group
University of California at Davis
530.754.7341

Dylan Beaudette wrote:

I am writing a new module that draws to the active monitor using the function
G_plot_line (x, y, x+dx, y+dy);

The line is drawn, but it is not persistant on the screen- in the way that the
output from something like d.grid would be. Poking around in the source code
for d.vect.thematic I found the following code, that *appears* to make the
lines persistant on the screen... but I am not sure how to interpret these
functions:
-----------------from d.vect.chart ------------------------
if(ret == 0) {
  D_add_to_list(G_recreate_command()) ;
        D_set_dig_name(G_fully_qualified_name(map_opt->answer, mapset));
        D_add_to_dig_list(G_fully_qualified_name(map_opt->answer, mapset));
-----------------------------------------------------------------

inserting D_add_to_list(G_recreate_command()) into my new module seems to
make the line persistant, but why?

G_recreate_command() returns the command line which was used to run
the program. D_add_to_list() adds a command to a list stored within
the monitor. When the monitor window is resized, the driver runs all
of the commands in the list to redraw the window.

The list is also used to generate the output from d.save.

--
Glynn Clements <glynn@gclements.plus.com>