[GRASS-dev] v.digit startup error from -n position

Michael Barton michael.barton at asu.edu
Wed Aug 2 18:58:22 EDT 2006


OK. I get it (I think). This is a problem in the v.digit code itself, not
with the TclTk wrappers that parse it for the GUI.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics and Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton


> From: Glynn Clements <glynn at gclements.plus.com>
> Date: Wed, 2 Aug 2006 23:28:25 +0100
> To: Michael Barton <michael.barton at asu.edu>
> Cc: Maciej Sieczka <tutey at o2.pl>, Markus Neteler <neteler at itc.it>, GRASS
> developers list <grass-dev at grass.itc.it>
> Subject: Re: [GRASS-dev] v.digit startup error from -n position
> 
> 
> Michael Barton wrote:
> 
>> OK. Looking through to the very bottom of the thread, there appears to be
>> some confusion about what is meant by GUI.
>> 
>> If v.digit is having a problem with a new vector when run from the toolbar
>> button in gism, it  is one thing. This SHOULD be OK. I've checked the code
>> and it is written...
>> 
>>   v.digit -n map=new_map
>> 
>> ... as Glynn indicated. If this is where the problem lies, then, there is
>> some other kind of issue.
> 
> Contrary to the "resolved" status in the RT, the real bug remains.
> 
> v.digit is calling Tk_Main() as:
> 
>     Tk_Main(argc, argv, Tcl_AppInit);
> 
> where argc/argv are those passed to main.
> 
> It shouldn't be doing this; it should be passing a dummy argv, e.g.
> 
>     char *fake_argv[2];
> ...
>     fake_argv[0] = argv[0];
>     fake_argv[1] = NULL;
>     Tk_Main(1, fake_argv, Tcl_AppInit);
> 
> Changing the order of v.digit's arguments is a workaround, not a fix.
> 
>> Glynn also noted, however, that in the auto-generated GUI dialogs, this is
>> being written as...
>> 
>>   v.digit map=new_map -n
>> 
>> This causes a problem because the -n is misinterpreted by TclTk as a flag in
>> the TclTk command. So if the problem arises when v.digit is run from a menu
>> or the dialog is started from the CLI by simply typing v.digit, then THIS is
>> where the problem lies.
>> 
>> Generically, the GRASS flags should come before any other arguments it
>> seems. I don't know where this is coded, but Cedric should know.
> 
> The generate_tcl() function in lib/gis/parser.c writes out a list of
> flags/options, with the flags last. gui.tcl passes the command-line
> options to the module in their original order, i.e. with the flags
> last.
> 
> This isn't a problem, as G_parser() doesn't care about the order. The
> fact that putting the flags first happens to work around the bug in
> v.digit is a coincidence, but not a particularly relevant one: v.digit
> should still be fixed.
> 
> -- 
> Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list