Hello Maris

On Sun, 2 Sep 2007, Maris Nartiss wrote:

Sorry for jumping-in.
I may be not following hard enough, but I just tested error catching
in lib/init/file_option.tcl proc fileOpt::create_loc and it works in
both cases:
1) Try to create new location from GDAL unsupported file -> outputs
g.proj error;
2) Move all GDAL libs to some other place and then try to create new
location -> outputs "shared library not found" error.
IMHO both of them are most common errors and having reported to user
in some user-friendly way is good thing. Any other common problem that
should be tested?

Yes I think it works quite well there. I copied some of what you did in file_option.tcl for my recent improvements to epsg_option.tcl. The way I see it is that because the catch function takes an optional argument - a variable to catch whatever is written to stderr - there is no need to redirect stderr to a file. In effect we use the catch command to "catch" the stderr output.

DialogGen works well for popping up clear error messages with the same look and file as the rest of the GUI (in fact I changed it so the border on the OK button looks the same as the other buttons in gis_set.tcl and associated dialogs). tk_messageBox (on Windows anyway) resulted in a dialog box with a totally different look and feel and to me at least it seemed a bit inconsistent in regard to which windows it popped up in front of. I wouldn't recommend using it - I changed a couple of occurences of it in epsg_option.tcl to use DialogGen instead.

Paul

_______________________________________________
grass-dev mailing list
[email protected]
http://grass.itc.it/mailman/listinfo/grass-dev

Reply via email to