Index: tolbase/lib/toltk/tclIndex
===================================================================
--- tolbase/lib/toltk/tclIndex	(revision e0578ae108a6dc7f85f8bb74823f6119b63416c0)
+++ tolbase/lib/toltk/tclIndex	(revision 073193871e6a7cb0a170a978a7bd45eb0b7dcced)
@@ -362,5 +362,4 @@
 set auto_index(::TolInspector::SelectGrammar) [list source [file join $dir tolinspe__wtree1.tcl]]
 set auto_index(::TolInspector::SelectSet) [list source [file join $dir tolinspe__wtree1.tcl]]
-set auto_index(::TolInspector::GetParentGrammar) [list source [file join $dir tolinspe__main.tcl]]
 set auto_index(::TolInspector::OpenVariable) [list source [file join $dir tolinspe__wtree1.tcl]]
 set auto_index(::TolInspector::SelectItem) [list source [file join $dir tolinspe__wtree1.tcl]]
@@ -398,4 +397,5 @@
 set auto_index(::TolInspector::SelectionExpand) [list source [file join $dir tolinspe__wtree2.tcl]]
 set auto_index(::TolInspector::SelectionCollapse) [list source [file join $dir tolinspe__wtree2.tcl]]
+set auto_index(::TolInspector::ToggleItem) [list source [file join $dir tolinspe__wtree2.tcl]]
 set auto_index(::TolInspector::DrawSet) [list source [file join $dir tolinspe__draw.tcl]]
 set auto_index(::TolInspector::DrawMatrix) [list source [file join $dir tolinspe__draw.tcl]]
Index: tolbase/lib/toltk/tolinspe__main.tcl
===================================================================
--- tolbase/lib/toltk/tolinspe__main.tcl	(revision e0578ae108a6dc7f85f8bb74823f6119b63416c0)
+++ tolbase/lib/toltk/tolinspe__main.tcl	(revision 073193871e6a7cb0a170a978a7bd45eb0b7dcced)
@@ -297,5 +297,5 @@
   
   # expand/collapse (and fill/unfill) a node with a double clic
-  bind ${wt_tree}.frameTree.t <Double-1> "$wt_tree item toggle \[ $wt_tree selection get 0 \]"
+  bind ${wt_tree}.frameTree.t <Double-1> "::TolInspector::ToggleItem %x %y"
 }
 
@@ -314,21 +314,18 @@
   variable wt_funcs
   
-  # creates the tabset to display the variables & functions    
-  #set w_tabset [::blt::tabset $paneRight.ts -relief flat\
-            -bd 0 -outerpad 0 -tier 2 -slant none -textside top \
-            -highlightthickness 0 -side left -rotate 90]
-  set w_tabset [::blt::tabset $paneRight.ts -relief flat\
-            -bd 0 -outerpad 0 -tier 2 -slant right -textside right \
-            -highlightthickness 0]
+  # creates the tabset to display the variables & functions
+  set w_tabset [NoteBook $paneRight.nb -tabbevelsize 8 -tabpady {2 6} \
+    -font $toltk_options(fonts,Label)]            
+  
+  # inserts in the tabset the tabs of functions and variables        
+  $w_tabset insert 0 Variables -text [mc Variables] -image [::Bitmap::get Variables] -background \#d9d9d9
+  $w_tabset insert 1 Functions -text [mc Functions] -image [::Bitmap::get Functions] -background \#d9d9d9
+  $w_tabset raise Variables
+  
   # creates the scrolled windows for each one of the tabs
-  set sw21 [ScrolledWindow $w_tabset.sw12 -scrollbar none]  
-  set sw22 [ScrolledWindow $w_tabset.sw22 -scrollbar none]
-  
-  # inserts in the tabset the tabs of functions and variables
-  $w_tabset insert end \
-      Variables -text [mc Variables] -selectbackground \#d9d9d9 -bg gray75 \
-      -image [::Bitmap::get Variables] -pady 0\
-      Functions -text [mc Functions] -selectbackground \#d9d9d9 -bg gray75 \
-      -image [::Bitmap::get Functions] -pady 0
+  set tab1 [$w_tabset getframe Variables]
+  set tab2 [$w_tabset getframe Functions] 
+  set sw21 [ScrolledWindow $tab1.sw12 -scrollbar none]  
+  set sw22 [ScrolledWindow $tab2.sw22 -scrollbar none] 
 
   # Creation of the right TREE RIGHT with VARIABLES
@@ -345,5 +342,5 @@
   $wt_vars notify bind $wt_vars <Selection> "::TolInspector::SelectItem $wt_vars"
   #@! el bind deberÃ­a poder hacerse directamente sobre el wtree
-  bind ${wt_vars}.frameTree.t  <Button-1> "::focus $wt_vars"    
+  bind ${wt_vars}.frameTree.t <Button-1> "::focus $wt_vars"    
   bind ${wt_vars}.frameTree.t <Double-1> "::TolInspector::SelectionExpand"
   
@@ -365,13 +362,15 @@
   $sw22 setwidget $wt_funcs  
   # configure the tabs
-  $w_tabset tab configure Variables -window $sw21 -fill both -padx 0 
-  $w_tabset tab configure Functions -window $sw22 -fill both -padx 0
+  $tab1 configure -borderwidth 2 -background \#d9d9d9
+  $tab2 configure -borderwidth 2 -background \#d9d9d9
 
   # packing the tabset
-  pack $w_tabset -fill both -expand yes
-  $w_tabset tab configure Variables\
-         -command "::TolInspector::SelectItem $wt_vars"
-  $w_tabset tab configure Functions\
-         -command "::TolInspector::SelectItem $wt_funcs"
+  pack $tab1.sw12 -fill both -expand yes
+  pack $tab2.sw22 -fill both -expand yes    
+  pack $w_tabset -fill both -expand yes  
+  #@! $w_tabset tab configure Variables\
+  #@!        -command "::TolInspector::SelectItem $wt_vars"
+  #@! $w_tabset tab configure Functions\
+  #@!        -command "::TolInspector::SelectItem $wt_funcs"
 }
 
@@ -569,16 +568,4 @@
 #>> proc ::TolInspector::SelectGrammar
 #>> proc ::TolInspector::SelectSet
-
-#/////////////////////////////////////////////////////////////////////////////
-proc ::TolInspector::GetParentGrammar { set_ref } {
-#/////////////////////////////////////////////////////////////////////////////
-  set root [ lindex $set_ref 0 ]
-  set L [ llength $set_ref ]
-  if { ( $root eq "File" && $L <= 2 ) } {
-    set root
-  } else {
-    lindex [ tol::info var $set_ref ] 0
-  }
-}
 
 #>> [tolinspe_wtree1.tcl]
Index: tolbase/lib/toltk/tolinspe__wtree1.tcl
===================================================================
--- tolbase/lib/toltk/tolinspe__wtree1.tcl	(revision e0578ae108a6dc7f85f8bb74823f6119b63416c0)
+++ tolbase/lib/toltk/tolinspe__wtree1.tcl	(revision 073193871e6a7cb0a170a978a7bd45eb0b7dcced)
@@ -125,5 +125,5 @@
 
   set parent_grammar $arguments(parent_grammar)  
-
+  
   #@ Si la llamada a InsertChild viene de SelectSet el argumento tolref 
   #@ no estÃ¡ definido y se crea a partir de parent_tolref
@@ -183,11 +183,22 @@
   #?   }
   #? }
-    
-  #@ ::TolInspector::LNode index grammar 
+  
+  #@ ::TolInspector::RNode index grammar 
   #@   icon name content description path reference
-  set wt_row [::TolInspector::RNode $arguments(index) $grammar \
-    $icon_grammar $name $data3 $brief_desc $path $tolref]
-  
-  set idx [$wt insert $wt_row -at child -relative root]
+  #@! set wt_row [::TolInspector::RNode $arguments(index) $grammar \
+    $icon_grammar $name $data3 $brief_desc $path $tolref]  
+  #@! set idx [$wt insert $wt_row -at child -relative root]
+  #@! Las lÃ­neas anteriores parecen lentas y se sustituyen por las siguientes:
+  set idx [$wt item create -button 1]
+  $wt item element configure $idx \
+    [RiIndex] eTXT -text $arguments(index) , \
+    [RiGrammar] eTXT -text $grammar , \
+    [RiName] eIMG -image $icon_grammar + eTXT -text $name , \
+    [RiContent] eTXT -text $data3 , \
+    [RiDescription] eTXT -text $brief_desc , \
+    [RiPath] eTXT -text $path , \
+    [RiReference] eTXT -text $tolref
+  $wt item lastchild root $idx  
+ 
   $wt item element configure $idx \
     [RiIndex] eTXT -fill $fcolor , \
@@ -196,5 +207,5 @@
     [RiDescription] eTXT -fill $fcolor , \
     [RiPath] eTXT -fill $fcolor
-  
+
   incr arguments(index)
 }
@@ -211,15 +222,14 @@
   variable OnSelectItem
 
-  foreach it [$wt_vars item children root] {
-    $wt_vars item delete $it
-  }
-  foreach it [$wt_funcs item children root] {
-    $wt_funcs item delete $it
-  }  
+  $wt_vars selection clear
+  $wt_vars item delete all
+  $wt_funcs selection clear
+  $wt_funcs item delete all
+
   #@ToDo $wt_vars  column configure Index -hide no
   #@ToDo $wt_funcs column configure Index -hide no
   
-  $w_tabset tab configure Variables -text [mc Variables] -state normal
-  $w_tabset tab configure Functions -state normal
+  $w_tabset itemconfigure Variables -text [mc Variables] -state normal 
+  $w_tabset itemconfigure Functions -state normal
 
   if { [string length $OnSelectItem] } {
@@ -264,5 +274,5 @@
     #@  + parent_grammar es usado por InsertSubset para abrir o no un nodo
     #@  + parent_tolref es usado por InsertSubset para determinar tolref
-    set arguments(parent_grammar) [GetParentGrammar $tolReference]     
+    set arguments(parent_grammar) [$wt_tree item text $node [LiGrammar]]
     set arguments(parent_tolref) $tolReference
     ::tol::forallchild $tolReference ::TolInspector::InsertSubset
@@ -399,5 +409,5 @@
   set parent_grammar $arguments(parent_grammar)
   #@ para obtener el icono de las instancias
-  set parent_tolref $arguments(parent_tolref)  
+  set parent_tolref $arguments(parent_tolref)
   
 #@# Tolcon_Trace "InsertSubset $args"   
@@ -464,9 +474,11 @@
   variable wt_tree
   variable arguments
-
+  
   set node [$wt_tree selection get 0]
   if { ![string length $node] } return
   if { $node == 0 } {
     ClearHiertables
+    #@D $w_tabset itemconfigure Variables -state disabled
+    #@D $w_tabset itemconfigure Functions -state disabled    
     return
   }
@@ -478,5 +490,5 @@
     #@ AquÃ­ llegan los nodos raÃ­z y las gramÃ¡ticas
     #@ Argumentos pasados por atributo
-    #@  + parent_grammar es usado por InsertItem para determinar el color de sus miembros si es NameBlock      
+    #@  + parent_grammar es usado por InsertItem para saber si es NameBlock  
     set arguments(parent_grammar) ""
     switch $tolReference {
@@ -484,12 +496,19 @@
       File    SelectFileRoot
       Console SelectConsoleRoot
-      default ClearHiertables
+      default {
+        ClearHiertables
+        #@D $w_tabset itemconfigure Variables -state disabled
+        #@D $w_tabset itemconfigure Functions -state disabled
+      }
     }
   } elseif { [lindex $tolReference 0] == "Grammar" } {
     #@ Argumentos pasados por atributo
-    #@  + parent_grammar es usado por InsertItem para determinar el color de sus miembros si es NameBlock  
+    #@  + parent_grammar es usado por InsertItem para saber si es NameBlock
     set arguments(parent_grammar) ""
     SelectGrammar
   } else {
+    #@ Argumentos pasados por atributo
+    #@  + parent_grammar es usado por InsertItem para saber si es NameBlock
+    set arguments(parent_grammar) [$wt_tree item text $node [LiGrammar]]
     SelectSet $tolReference
   }
@@ -513,5 +532,7 @@
 
   ClearHiertables
-  $w_tabset select 0 ;# Variables
+  $w_tabset itemconfigure Variables -text [mc Packages]  
+  $w_tabset raise Variables  
+  #@D $w_tabset itemconfigure Functions -state disabled  
   
   #@=> tiene que incrementarse automÃ¡ticamente es el contador del foreach  
@@ -543,7 +564,7 @@
 
   ClearHiertables
-  $w_tabset tab configure Variables -text [mc Files]
-  #  $w_tabset tab configure Functions -state disabled
-  $w_tabset select 0 ;# Variables
+  $w_tabset itemconfigure Variables -text [mc Files]
+  $w_tabset raise Variables
+  #@D $w_tabset itemconfigure Functions -state disabled
   
   #@=> tiene que incrementarse automÃ¡ticamente es el contador del foreach  
@@ -568,5 +589,4 @@
 #
 #/////////////////////////////////////////////////////////////////////////////
-  variable w_tabset
   variable wt_tree
   variable arguments
@@ -577,10 +597,11 @@
 
   ClearHiertables
+
 #(pgea) se quita la linea que oculta la columna del indice y que
 #(pgea) el procedimimento anterior ClearHiertables muestra
 #  $ht_vars column  configure Index -hide yes
-#  $w_tabset tab configure Functions -state disabled
   
   foreach co [::tol::console stack list] {
+  Tolcon_Trace "co $co"
     #puts "SelectConsoleRoot: co = $co"
     set gra  [lindex $co 0]
@@ -662,6 +683,6 @@
     }
   } else {
-#    $w_tabset tab configure Variables -state disabled
-#    $w_tabset select 1
+    $w_tabset raise Functions  
+    #@D $w_tabset itemconfigure Variables -state disabled
   }
   foreach fun  [::tol::info functions $grammar] {
@@ -689,12 +710,10 @@
   
   #@ Argumentos pasados por atributo
-  #@  + index es usado e incrementado por InsertItem      
-  #@  + parent_grammar es usado por InsertItem para determinar el color de sus miembros si es NameBlock
+  #@  + index es usado e incrementado por InsertItem
   #@  + tolref indica a InsertItem que se ha de obtener desde parent_tolref
   #@  + parent_tolref es usado por InsertItem para encontrar tolref  
   set arguments(index) 1  
-  set arguments(parent_grammar) [GetParentGrammar $tolReference]
   set arguments(tolref) ""
-  set arguments(parent_tolref) $tolReference  
+  set arguments(parent_tolref) $tolReference 
   ::tol::forallchild $tolReference ::TolInspector::InsertChild
 }
Index: tolbase/lib/toltk/tolinspe__wtree2.tcl
===================================================================
--- tolbase/lib/toltk/tolinspe__wtree2.tcl	(revision e0578ae108a6dc7f85f8bb74823f6119b63416c0)
+++ tolbase/lib/toltk/tolinspe__wtree2.tcl	(revision 073193871e6a7cb0a170a978a7bd45eb0b7dcced)
@@ -58,4 +58,5 @@
   $wt_tree selection clear
   $wt_tree selection add $idx_con
+
   #Tolcon_Trace "Abierto el nodo root-console"
   if { [$wt_tree item state get $idx_con focus] } {
@@ -664,8 +665,4 @@
 #
 #/////////////////////////////////////////////////////////////////////////////
-  #set found [$ht find]
-  #if {[llength $found] > 1} {
-  #  $ht selection set [lindex $found 1] [lindex $found end]
-  #} 
   $wt selection add 0 end
 }
@@ -680,8 +677,4 @@
 #
 #/////////////////////////////////////////////////////////////////////////////
-  #set found [$ht find]
-  #if {[llength $found] > 1} {
-  #  $ht selection toggle [lindex $found 1] [lindex $found end]
-  #} 
   set sel [$wt selection get 0 end]
   $wt selection add 0 end
@@ -713,2 +706,15 @@
   }
 }
+
+#/////////////////////////////////////////////////////////////////////////////
+proc ::TolInspector::ToggleItem { x y } {
+#/////////////////////////////////////////////////////////////////////////////
+  variable wt_tree
+
+  set lstxy [$wt_tree identify $x $y]
+  if { [llength $lstxy] } {
+    if { [lindex $lstxy 0] == "item" } {
+      $wt_tree item toggle [lindex $lstxy 1]
+    }
+  }
+}
