[GRASS-dev] ganim troubles in latest cvs

Michael Barton michael.barton at asu.edu
Mon Oct 1 22:17:32 EDT 2007


Kirk,

You seem to be missing a line (maybe my fault). Note the line defining
reglist.


Michael
=====================================

    set reglist [split $region "\n"]
    
    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]}
        }
    
    }



On 10/1/07 6:36 AM, "Kirk Wythers" <kwythers at umn.edu> wrote:

> 
> 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
> 
> 
> 
> 
> 

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

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





More information about the grass-dev mailing list