[GRASS-dev] Re: gis.m: error message when trying to add layer without open map display

Hamish hamish_nospam at yahoo.com
Thu Feb 8 18:57:57 EST 2007


Moritz:
> > Since you have been busy working on error catching in gis.m: I've
> > always found that the error that occurs when you try to add a layer
> > even though there is no open map display quite difficult to
> > understand for newbies:
> > 
> > invalid command name
> > ".mainframe.frame.pw1.f0.frame.pgs.fpage_1.sw.tree_1" invalid
> > command name ".mainframe.frame.pw1.f0.frame.pgs.fpage_1.sw.tree_1"
> >      while executing
> > "$tree($mon) selection get"
..
> > Would it be possible to catch this and produce a nicer error message
> > such as: "You need to open a map display first." ?

Michael:
> I'll try to see what's going on with this. It probably has to do with
> the necessary link between a layer tree and a display. A better error
> message would likely be "You need to open a display before adding map
> layers"

Even better: Don't bother with error messages, do what the user wanted:
open a new display if needed & add the layer.


Hamish




More information about the grass-dev mailing list