[GRASS-dev] ganim troubles in latest cvs

Kirk Wythers kwythers at umn.edu
Mon Oct 1 09:36:30 EDT 2007


On Sep 30, 2007, at 11:23 PM, Michael Barton wrote:

> Well, after asking for help, I figured out how to this without the  
> dread
> regexp ;-). This might even be a bit better routine.
>
> Anyway, I can't commit this because I'm out of town, but if anyone  
> wants to
> try it, you need to change lines in procedure GmAnim::main (module
> animate.tcl). Replace the commented lines with the uncommented  
> lines below.
>
>     foreach line $reglist {
>         set line [string trim $line]
>         set key [lindex [split $line "="] 0]
>         switch $key {
>             nsres    {set oldres1 [lindex [split $line "="] 1]}
>             ewres   {set oldres2 [lindex [split $line "="] 1]}
>             rows    {set vrows [lindex [split $line "="] 1]}
>             cols    {set vcols [lindex [split $line "="] 1]}
>         }
>
>     }
>
> #     regexp {nsres= *([0-9]+)} $region dummy oldres1
> #     regexp {ewres= *([0-9]+)} $region dummy oldres2
> #     regexp {rows= *([0-9]+)} $region dummy vrows
> #     regexp {cols= *([0-9]+)} $region dummy vcols
>
>

Michael,

Thanks for the email. I made the following changes but ended up with  
a new error. I might have altered the wrong file. Here is what I tried.

 From the file ~/src_intel/grass-6.3.cvs/gui/tcltk/gis.m/animate.tcl

     # set initial canvas geometry to match region
     if {[catch {set region [exec g.region -ugp]} error]} {
         Gm::errmsg $error
     }

    # regexp {nsres= *([0-9]+)} $region dummy oldres1
    # regexp {ewres= *([0-9]+)} $region dummy oldres2
    # regexp {rows= *([0-9]+)} $region dummy vrows
    # regexp {cols= *([0-9]+)} $region dummy vcols

     foreach line $reglist {
         set line [string trim $line]
         set key [lindex [split $line "="] 0]
         switch $key {
             nsres    {set oldres1 [lindex [split $line "="] 1]}
             ewres   {set oldres2 [lindex [split $line "="] 1]}
             rows    {set vrows [lindex [split $line "="] 1]}
             cols    {set vcols [lindex [split $line "="] 1]}
         }

     }

New error when startring up GmAnim.

can't read "reglist": no such variable
can't read "reglist": no such variable
     while executing
"foreach line $reglist {
         set line [string trim $line]
         set key [lindex [split $line "="] 0]
         switch $key {
             nsres    {..."
     (procedure "GmAnim::main" line 28)
     invoked from within
"GmAnim::main"
     ("uplevel" body line 1)
     invoked from within
"uplevel \#0 $cmd"
     (procedure "Button::_release" line 18)
     invoked from within
"Button::_release .mainframe.topf.tb1.bbox4.b0"
     (command bound to event)

Perhaps this is not what you intended?

Kirk








More information about the grass-dev mailing list