[GRASS5] d.legend and d.out.png

Glynn Clements glynn.clements at virgin.net
Thu Aug 19 16:49:55 EDT 2004


Markus Neteler wrote:

> may it be possible that 'd.legend' doesn't add
> itself completely to the XDRIVER list?

	if(!use_mouse)
	    D_add_to_list(G_recreate_command()) ;

I.e. it should add itself to the list, unless you use the mouse for
placement (obviously, adding interactive commands such as
"d.legend -m ..." to the redraw list isn't a good idea).

One possibility is to modify the string returned by
G_recreate_command(), i.e. remove the -m switch and add an at= option
corresponding to the the position that was selected using the mouse.

Or just construct the command directly without using
G_recreate_command() at all ("d.barscale -m" does this). Although,
with this approach, if someone subsequently adds a new option or flag,
it's as likely as not that they'll overlook the need to add it to the
code which constructs the command line.

Also, I'll use this space to note that tcltkgrass should use a
terminal (or, at least, an output window) when runninng d.legend with
the -m switch, so that the instructions can be seen.

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-dev mailing list