Changeset 64bb607 in tol


Ignore:
Timestamp:
Jun 18, 2009, 1:28:49 PM (17 years ago)
Author:
Jorge Pérez <josp.jorge@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
4c3ff30
Parents:
cfc30c0
Message:

TolInspector::CallUserFunction use the address obtained from tol::info address and pass the object to the gui functions through the TOL function GetObjectFromAddress

relates to #695.

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@1089 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tolbase/lib/toltk/tolinspe.tcl

    rcfc30c0 r64bb607  
    13051305      set node_prefix $node_type
    13061306          #puts "SelectObject: node_prefix = $node_prefix"
    1307           if {[regexp -- "pool" $node_type]} {
     1307      if {[regexp -- "pool" $node_type]} {
    13081308        set tolset $data(pool,reference,[lindex $node_type 0])
    13091309        #puts "SelectObject: Spool: tolset=$tolset, info_node=$info_node"
    … …  
    31883188  #puts "CallUserFunction. grammar=$grammar, idx=$idx, items_selected=$items_selected"
    31893189 
    3190   set itemsName ""
     3190  set all_objs [ list ]
    31913191  foreach it $items_selected {
    3192     set namTol [TclRefToNameTol $it]
    3193     if  {[string length $namTol]} {
    3194       lappend itemsName [TclRefToNameTol $it]
    3195       #lappend itemsName [lindex $it 1]
    3196     } else {
    3197       tk_messageBox -type ok -icon info \
    3198                     -message [mc "VarWithoutNameNotFunc"] \
    3199                     -title [mc "Warning"]
    3200       return 0
    3201     }
    3202   }
    3203 
    3204   if { [llength $itemsName] } {
     3192    set tcl_ref [ lindex $it 0 ]
     3193    set obj_addr [ ::tol::info address $tcl_ref ]
     3194    lappend all_objs "GetObjectFromAddress(\"$obj_addr\")"
     3195  }
     3196
     3197  if { [ llength $all_objs ] } {
    32053198    incr group_id
    32063199    array set regFun $regFunLst
    32073200    set gui [bguifunction .t$group_id \
    3208        -title $regFun($idx,nameGui) \
    3209        -regpars $regFun($idx,parameters)]
     3201                 -title $regFun($idx,nameGui) \
     3202                 -regpars $regFun($idx,parameters)]
    32103203    set txtPars [join [$gui get values] ,]
    32113204    if {$txtPars ne ""} {
    … …  
    32163209    switch [lindex $typeGui 0] {
    32173210      Ite {
    3218         foreach item $itemsName {
    3219           set cmd "$regFun($idx,typeOut) $regFun($idx,nameFun) ($item $txtPars)"
     3211        foreach obj $all_objs {
     3212          set cmd "$regFun($idx,typeOut) $regFun($idx,nameFun) ($obj $txtPars)"
    32203213          #Tolcon_Trace "Ite.cmd=$cmd"
    32213214          ::tol::console eval $cmd
    … …  
    32243217      }
    32253218      Set {
    3226         set item [join $itemsName ,]
    3227         set setCmd "SetOf[lindex $typeGui 1] ($item)"
     3219        set obj_args [join $all_objs ,]
     3220        set setCmd "SetOf[lindex $typeGui 1] ($obj_args)"
    32283221        set cmd "$regFun($idx,typeOut) $regFun($idx,nameFun) ($setCmd $txtPars)"
    32293222        #Tolcon_Trace "Set.cmd=$cmd"
Note: See TracChangeset for help on using the changeset viewer.