[GRASS-dev] Re: [GRASS GIS] #902: nviz (tcl) fails on wingrass

GRASS GIS trac at osgeo.org
Mon Feb 8 16:25:38 EST 2010


#902: nviz (tcl) fails on wingrass
-----------------------+----------------------------------------------------
  Reporter:  hamish    |       Owner:  grass-dev at lists.osgeo.org
      Type:  defect    |      Status:  new                      
  Priority:  critical  |   Milestone:  6.4.0                    
 Component:  NVIZ      |     Version:  svn-trunk                
Resolution:            |    Keywords:                           
  Platform:  All       |         Cpu:  All                      
-----------------------+----------------------------------------------------
Comment (by glynn):

 Replying to [comment:14 hamish]:
 > Ok, now it seems to work ok from the 6.5 command line and GUIs. So
 backported to 6.4.
 >
 > but still a weird problem in trunk:
 >
 >  * G7> nviz --ui
 >  * (module option gui opens)
 >  * select raster elevation: elevation.dem at PERMANENT
 >  * [Run]
 >  * a window flashes open then closes again and this is written to the
 module GUI output tab:

 Ugh. Try this:

 {{{
 --- visualization/nviz/src/nviz_init.c  (revision 40859)
 +++ visualization/nviz/src/nviz_init.c  (working copy)
 @@ -137,7 +137,7 @@
       * If left in it treats it as a elev arg and tries to open
       */
      argv2 = G_malloc((argc + 2) * sizeof(char *));
 -    argv2[0] = (char *) cmd;
 +    argv2[0] = "nviz";
      for (ii = 0; ii < argc; ii++)
         argv2[ii + 1] = (char *)argv[ii];
      argv2[argc + 1] = NULL;
 }}}

 No idea why it would work in 6.x without this.

 I think that it might be better to change the startup, moving the top of
 parse_command() (everything up to and including the G_parser() call) into
 main(), so that it's a normal "GRASS module" main(). If G_parser()
 indicates normal operation (i.e. not --help, --ui, etc), we call Tk_Main()
 with "fabricated" argc and argv (i.e. insert the "-f nviz2.2_script"). For
 --help, --ui etc, Tcl/Tk never gets involved.

 This doesn't allow the nviz binary to be used to run arbitrary scripts,
 but I'm not so sure that works anyhow.

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/902#comment:16>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list