Here is an untested patch for 1.07 which should fix the grid bug and
 a few others. Let me know if it works for you.


*** vt-1.07/vt.tcl      Fri Jan 10 03:23:08 1997
--- vt-1.08/vt.tcl      Mon Jan 13 18:08:17 1997
***************
*** 111,125 ****
      if {$tcl_platform(platform) == "macintosh"} {
          set vTcl(balloon,on) 0
      }
!     if {$tcl_platform(platform)=="unix" || $tk_version < 8} {
          option add *font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*
          option add *Scrollbar.borderWidth 1
          option add *Scrollbar.width 10
          option add *Text*font fixed
      } else {
          option add *font {Helvetica 12}
          option add *Text*font {Courier 12}
!       }
      vTcl:setup_bind_tree .
      vTcl:load_images
      Window show .vTcl
--- 116,133 ----
      if {$tcl_platform(platform) == "macintosh"} {
          set vTcl(balloon,on) 0
      }
!     if {$tk_version < 8} {
          option add *font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*
          option add *Scrollbar.borderWidth 1
          option add *Scrollbar.width 10
          option add *Text*font fixed
      } else {
+         if {$tcl_platform(platform) == "unix"} {
+             option add *Scrollbar.width 10
+         }
          option add *font {Helvetica 12}
          option add *Text*font {Courier 12}
!     }
      vTcl:setup_bind_tree .
      vTcl:load_images
      Window show .vTcl
***************
*** 145,151 ****
          wm geometry $vTcl(gui,main) +0+0
      }
      catch {wm geometry .vTcl $vTcl(geometry,.vTcl)}
!     bind $vTcl(gui,main) <Destroy> vTcl:wm_quit
      set tmp $vTcl(gui,main).menu
      frame $tmp -relief flat
      frame .vTcl.stat -relief flat
--- 153,159 ----
          wm geometry $vTcl(gui,main) +0+0
      }
      catch {wm geometry .vTcl $vTcl(geometry,.vTcl)}
!     wm protocol .vTcl WM_DELETE_WINDOW {vTcl:quit}
      set tmp $vTcl(gui,main).menu
      frame $tmp -relief flat
      frame .vTcl.stat -relief flat
***************
*** 443,448 ****
--- 451,459 ----
  
  proc vTcl:main {argc argv} {
      global env vTcl tcl_version tcl_platform
+     catch {package require Unsafe} ; #for running in Netscape
+     catch {package require dde}    ; #for windows
+     catch {package require Tk}     ; #for dynamic loading tk
      if {$tcl_version < 7.5} {
          wm deiconify .
          wm title . "Time to upgrade"
***************
*** 465,472 ****
          if {![info exists env(VTCL_HOME)]} {
              set home [file dirname [info script]]
              switch [file pathtype $home] {
!                 absolute { set env(VTCL_HOME) $home }
!                 relative { set env(VTCL_HOME) [file join [pwd] $home] }
                  volumerelative {
                      set curdir [pwd]
                      cd $home
--- 476,483 ----
          if {![info exists env(VTCL_HOME)]} {
              set home [file dirname [info script]]
              switch [file pathtype $home] {
!                 absolute {set env(VTCL_HOME) $home}
!                 relative {set env(VTCL_HOME) [file join [pwd] $home]}
                  volumerelative {
                      set curdir [pwd]
                      cd $home
***************
*** 476,486 ****
                  }
              }
          }
!         if { ![file isdir $env(VTCL_HOME)] } {
              set vTcl(VTCL_HOME) [pwd]
          }
-         catch { package require dde } ;#for windows
- 
          vTcl:setup
          if {$argc == 1} {
              vTcl:open [file join [pwd] $argv]
--- 487,495 ----
                  }
              }
          }
!         if {![file isdir $env(VTCL_HOME)]} {
              set vTcl(VTCL_HOME) [pwd]
          }
          vTcl:setup
          if {$argc == 1} {
              vTcl:open [file join [pwd] $argv]
diff -rc vt-1.07/lib/attredit.tcl vt-1.08/lib/attredit.tcl
*** vt-1.07/lib/attredit.tcl    Wed Jan  8 03:22:29 1997
--- vt-1.08/lib/attredit.tcl    Wed Jan 15 00:58:54 1997
***************
*** 57,63 ****
      if {$vTcl(var_update) == "no"} {
          return
      }
-     vTcl:update_widget_info $vTcl(w,widget)
      set fr $vTcl(gui,ae).fr
      set ca $fr._$vTcl(w,class)
      set top $ca.f
--- 57,62 ----
***************
*** 115,120 ****
--- 114,125 ----
                  $top.t$option.m add command -label "$i" -command \
                      "set $variable $i; $config_cmd; "
              }
+         }
+         menu {
+             button $top.t$option \
+                 -text "<edit>" -relief sunken -bd 1 -width 11 \
+                 -highlightthickness 1 -fg black \
+                 -command {vTcl:edit_menu [$vTcl(w,widget) cget -menu]} -anchor w
          }
          color {
              button $top.t$option \
diff -rc vt-1.07/lib/compound.tcl vt-1.08/lib/compound.tcl
*** vt-1.07/lib/compound.tcl    Fri Jan 10 02:06:18 1997
--- vt-1.08/lib/compound.tcl    Sat Jan 11 03:07:03 1997
***************
*** 233,239 ****
          foreach b {weight minsize} {
              set num [subst $$pre$a]
              for {set i 0} {$i < $num} {incr i} {
!                 set x [expr round([grid ${a}conf $target $i -$b])]
                  if {$x > 0} {
                      lappend grid "${a}conf $i -$b $x"
                  }
--- 233,241 ----
          foreach b {weight minsize} {
              set num [subst $$pre$a]
              for {set i 0} {$i < $num} {incr i} {
!                 if [catch {
!                     set x [expr round([grid ${a}conf $target $i -$b])]
!                 }] {set x 0}
                  if {$x > 0} {
                      lappend grid "${a}conf $i -$b $x"
                  }
diff -rc vt-1.07/lib/dump.tcl vt-1.08/lib/dump.tcl
*** vt-1.07/lib/dump.tcl        Thu Jan  9 02:27:43 1997
--- vt-1.08/lib/dump.tcl        Sun Jan 12 01:12:32 1997
***************
*** 24,31 ****
  proc vTcl:save_vars {} {
      global vTcl
      set output ""
!       set list $vTcl(vars)
!       lappend list widget
      foreach i $list {
          catch {
              if {$i != "auto_index" && $i != "auto_oldpath" &&
--- 24,31 ----
  proc vTcl:save_vars {} {
      global vTcl
      set output ""
!     set list $vTcl(vars)
!     lappend list widget
      foreach i $list {
          catch {
              if {$i != "auto_index" && $i != "auto_oldpath" &&
***************
*** 217,223 ****
          foreach b {weight minsize} {
              set num [subst $$pre$a]
              for {set i 0} {$i < $num} {incr i} {
!                 set x [expr round([grid ${a}conf $target $i -$b])]
                  if $x {
                      append result "$vTcl(tab)grid ${a}conf $target $i -$b $x\n"
                  }
--- 217,225 ----
          foreach b {weight minsize} {
              set num [subst $$pre$a]
              for {set i 0} {$i < $num} {incr i} {
!                 if [catch {
!                     set x [expr round([grid ${a}conf $target $i -$b])]
!                 }] {set x 0}
                  if $x {
                      append result "$vTcl(tab)grid ${a}conf $target $i -$b $x\n"
                  }
***************
*** 301,306 ****
--- 303,316 ----
  
  proc vTcl:dump_top {target} {
      global vTcl
+     if ![winfo exists $target] {
+         set procname $vTcl(winname)$target
+         if {[info procs $procname] != ""} {
+             set procargs [info args $procname]
+             set procbody [info body $procname]
+             return "\nproc $procname \{$procargs\} \{$procbody\}\n"
+         }
+     }
      if {[winfo class $target] != "Toplevel" && $target != "."} {
          return
      }
diff -rc vt-1.07/lib/file.tcl vt-1.08/lib/file.tcl
*** vt-1.07/lib/file.tcl        Wed Jan  8 23:51:52 1997
--- vt-1.08/lib/file.tcl        Sun Jan 12 18:59:33 1997
***************
*** 176,191 ****
      set vTcl(change) 0
  }
  
- proc vTcl:wm_quit {} {
-     global vTcl
-     if {$vTcl(change) > 0} {
-         if {[vTcl:dialog "Your application has unsaved changes.\nDo you wish to 
save?" "Yes No" 1] == "Yes"} {
-             vTcl:save_as
-         }
-     }
-     vTcl:exit
- }
- 
  proc vTcl:quit {} {
      global vTcl
      if {[vTcl:close] == -1} {return}
--- 176,181 ----
***************
*** 204,210 ****
      global vTcl
      set output ""
      set showlist ""
!     foreach i ".vTcl .vTcl.toolbar .vTcl.mgr .vTcl.ae
                 .vTcl.proclist .vTcl.varlist .vTcl.toplist" {
          if {[winfo exists $i]} {
              append output "set vTcl(geometry,${i}) [wm geometry $i]\n"
--- 194,200 ----
      global vTcl
      set output ""
      set showlist ""
!     foreach i ".vTcl .vTcl.toolbar .vTcl.mgr .vTcl.ae .vTcl.wstat
                 .vTcl.proclist .vTcl.varlist .vTcl.toplist" {
          if {[winfo exists $i]} {
              append output "set vTcl(geometry,${i}) [wm geometry $i]\n"
diff -rc vt-1.07/lib/globals.tcl vt-1.08/lib/globals.tcl
*** vt-1.07/lib/globals.tcl     Fri Jan 10 03:22:24 1997
--- vt-1.08/lib/globals.tcl     Wed Jan 15 00:55:10 1997
***************
*** 72,77 ****
--- 72,78 ----
  set vTcl(quit)           1
  set vTcl(tool,list)      ""
  set vTcl(tool,last)      ""
+ set vTcl(toolbar,width)  2
  set vTcl(tops)           ""
  set vTcl(undo)           ""
  set vTcl(vars)           ""
***************
*** 178,184 ****
      {0 1} }
  set vTcl(opt,-justify)             { Justify         longname   choice
      {left right center} }
! set vTcl(opt,-menu)                { Menu            longname   type    {} }
  set vTcl(opt,-offvalue)            { {Off Value}     longname   type    {} }
  set vTcl(opt,-onvalue)             { {On Value}      longname   type    {} }
  set vTcl(opt,-orient)              { Orient          longname   choice
--- 179,185 ----
      {0 1} }
  set vTcl(opt,-justify)             { Justify         longname   choice
      {left right center} }
! set vTcl(opt,-menu)                { Menu            longname   menu    {} }
  set vTcl(opt,-offvalue)            { {Off Value}     longname   type    {} }
  set vTcl(opt,-onvalue)             { {On Value}      longname   type    {} }
  set vTcl(opt,-orient)              { Orient          longname   choice
diff -rc vt-1.07/lib/lib_core.tcl vt-1.08/lib/lib_core.tcl
*** vt-1.07/lib/lib_core.tcl    Wed Jan  8 19:44:02 1997
--- vt-1.08/lib/lib_core.tcl    Wed Jan 15 01:01:45 1997
***************
*** 323,330 ****
  
  proc vTcl:edit_menu {target} {
      global vTcl
      vTcl:active_widget $target
!     if {[winfo class $target] != "Menu" || $target == ""} {return}
      set name [vTcl:rename $target]
      set base ".vTcl.menu_$name"
      if {[winfo exists $base]} "
--- 323,331 ----
  
  proc vTcl:edit_menu {target} {
      global vTcl
+     if {$target == ""} {return}
      vTcl:active_widget $target
!     if {[winfo class $target] != "Menu"} {return}
      set name [vTcl:rename $target]
      set base ".vTcl.menu_$name"
      if {[winfo exists $base]} "
diff -rc vt-1.07/lib/mgrs.tcl vt-1.08/lib/mgrs.tcl
*** vt-1.07/lib/mgrs.tcl        Wed Jan  8 20:13:49 1997
--- vt-1.08/lib/mgrs.tcl        Sat Jan 11 03:12:30 1997
***************
*** 34,52 ****
  proc vTcl:widget_gridconf {rc opt} {
  global vTcl
      set p [winfo parent $vTcl(w,widget)]
!     set name [string range $rc 0 2]
!     if {$rc == "column"} {
!         set num $vTcl(w,grid,-column)
!     } else {
!         set num $vTcl(w,grid,-row)
!     }
!     if {$opt == "weight"} {
!         grid ${rc}configure $p $num -weight \
!             [expr round($vTcl(w,grid,$name,$opt))]
!     } else {
!         grid ${rc}configure $p $num -minsize \
!             [expr round($vTcl(w,grid,$name,$opt))]
!     }
      vTcl:manager_update grid
  }
  
--- 34,41 ----
  proc vTcl:widget_gridconf {rc opt} {
  global vTcl
      set p [winfo parent $vTcl(w,widget)]
!       set num $vTcl(w,grid,-$rc)
!       grid ${rc}configure $p $num -$opt [expr round($vTcl(w,grid,$rc,$opt))]
      vTcl:manager_update grid
  }
  
***************
*** 354,360 ****
          -pady 0 
      entry .vTcl.mgr.xx.grid.fra13.ent24 \
          -borderwidth 1 \
!         -highlightthickness 0 -textvariable vTcl(w,grid,col,weight) -width 4 
      bind .vTcl.mgr.xx.grid.fra13.ent24 <Return> {
          vTcl:widget_gridconf column weight
      }
--- 343,349 ----
          -pady 0 
      entry .vTcl.mgr.xx.grid.fra13.ent24 \
          -borderwidth 1 \
!         -highlightthickness 0 -textvariable vTcl(w,grid,column,weight) -width 4 
      bind .vTcl.mgr.xx.grid.fra13.ent24 <Return> {
          vTcl:widget_gridconf column weight
      }
***************
*** 372,378 ****
          -pady 0 
      entry .vTcl.mgr.xx.grid.fra13.ent26 \
          -borderwidth 1 \
!         -highlightthickness 0 -textvariable vTcl(w,grid,col,width) -width 4 
      bind .vTcl.mgr.xx.grid.fra13.ent26 <Return> {
          vTcl:widget_gridconf column width
      }
--- 361,367 ----
          -pady 0 
      entry .vTcl.mgr.xx.grid.fra13.ent26 \
          -borderwidth 1 \
!         -highlightthickness 0 -textvariable vTcl(w,grid,column,minsize) -width 4 
      bind .vTcl.mgr.xx.grid.fra13.ent26 <Return> {
          vTcl:widget_gridconf column width
      }
***************
*** 381,387 ****
          -pady 0 
      entry .vTcl.mgr.xx.grid.fra13.ent27 \
          -borderwidth 1 \
!         -highlightthickness 0 -textvariable vTcl(w,grid,row,width) -width 4 
      bind .vTcl.mgr.xx.grid.fra13.ent27 <Return> {
          vTcl:widget_gridconf row width
      }
--- 370,376 ----
          -pady 0 
      entry .vTcl.mgr.xx.grid.fra13.ent27 \
          -borderwidth 1 \
!         -highlightthickness 0 -textvariable vTcl(w,grid,row,minsize) -width 4 
      bind .vTcl.mgr.xx.grid.fra13.ent27 <Return> {
          vTcl:widget_gridconf row width
      }
diff -rc vt-1.07/lib/misc.tcl vt-1.08/lib/misc.tcl
*** vt-1.07/lib/misc.tcl        Wed Jan  8 19:36:27 1997
--- vt-1.08/lib/misc.tcl        Sun Jan 12 18:41:25 1997
***************
*** 284,290 ****
      global vTcl
      set new ""
      foreach i $vTcl(procs) {
!         if [string match vTclWindow* $i] {
              set n [string range $i 10 end]
              if {$n != "."} {
                  lappend new [string range $i 10 end]
--- 284,290 ----
      global vTcl
      set new ""
      foreach i $vTcl(procs) {
!         if [string match $vTcl(winname)* $i] {
              set n [string range $i 10 end]
              if {$n != "."} {
                  lappend new [string range $i 10 end]
diff -rc vt-1.07/lib/status.tcl vt-1.08/lib/status.tcl
*** vt-1.07/lib/status.tcl      Tue Dec 31 22:48:45 1996
--- vt-1.08/lib/status.tcl      Sun Jan 12 18:58:09 1997
***************
*** 22,34 ****
  #
  
  proc vTcl:widget_status {} {
      global vTcl
  
!     set tmp $vTcl(gui,main).widgets
      if { [winfo exists $tmp] == 1 } { wm deiconify $tmp; return }
      toplevel $tmp -class vTcl
!     wm resizable $tmp 1 0
!     wm minsize $tmp 210 0
      wm title $tmp "Widget Info"
      frame $tmp.f1 -relief flat -bd 0
      frame $tmp.f2 -relief flat -bd 0
--- 22,38 ----
  #
  
  proc vTcl:widget_status {} {
+     Window show .vTcl.wstat
+ }
+ 
+ proc vTclWindow.vTcl.wstat {} {
      global vTcl
  
!     set tmp $vTcl(gui,main).wstat
      if { [winfo exists $tmp] == 1 } { wm deiconify $tmp; return }
      toplevel $tmp -class vTcl
!     wm resizable $tmp 1 1
!     wm minsize $tmp 210 75
      wm title $tmp "Widget Info"
      frame $tmp.f1 -relief flat -bd 0
      frame $tmp.f2 -relief flat -bd 0
***************
*** 64,69 ****
      pack $tmp.f4.l -side left
      pack $tmp.f4.e -side left -expand 1 -fill x
  
!       vTcl:setup_vTcl:bind $tmp
  }
  
--- 68,74 ----
      pack $tmp.f4.l -side left
      pack $tmp.f4.e -side left -expand 1 -fill x
  
!     catch {wm geometry .vTcl.wstat $vTcl(geometry,.vTcl.wstat)}
!     vTcl:setup_vTcl:bind $tmp
  }
  
diff -rc vt-1.07/lib/toolbar.tcl vt-1.08/lib/toolbar.tcl
*** vt-1.07/lib/toolbar.tcl     Fri Jan 10 02:51:39 1997
--- vt-1.08/lib/toolbar.tcl     Sun Jan 12 01:52:27 1997
***************
*** 31,36 ****
--- 31,39 ----
      wm grid $base 1 1 20 20
      wm geometry $base +0+110
      catch {wm geometry .vTcl.toolbar $vTcl(geometry,.vTcl.toolbar)}
+     wm protocol .vTcl.toolbar WM_DELETE_WINDOW {
+         vTcl:error "You cannot delete the toolbar"
+     }
  }
  
  proc vTcl:toolbar_add {type name image cmd_add} {
***************
*** 54,61 ****
      set base .vTcl.toolbar
      set num [llength [winfo children $base]]
      set w [expr [winfo width $base] / 20]
!     if {$w <= 0} {set w [expr $num / 7]}
!     if {$w <= 0} {set w 2}
      set h [expr $num / $w]
      set x 0
      set gr ""
--- 57,63 ----
      set base .vTcl.toolbar
      set num [llength [winfo children $base]]
      set w [expr [winfo width $base] / 20]
!     if {$w <= 0} {set w $vTcl(toolbar,width)}
      set h [expr $num / $w]
      set x 0
      set gr ""
***************
*** 71,77 ****
      if {$gr != ""} {
          eval "grid $gr"
      }
!       update idletasks
      wm deiconify $base
  }
  
--- 73,79 ----
      if {$gr != ""} {
          eval "grid $gr"
      }
!     update idletasks
      wm deiconify $base
  }
  
diff -rc vt-1.07/lib/widget.tcl vt-1.08/lib/widget.tcl
*** vt-1.07/lib/widget.tcl      Thu Jan  9 15:48:33 1997
--- vt-1.08/lib/widget.tcl      Sat Jan 11 03:13:39 1997
***************
*** 192,207 ****
      }
      if {$mgr == "grid"} {
          set p [winfo parent $target]
!         set col $vTcl(w,grid,-column)
!         set row $vTcl(w,grid,-row)
!         set vTcl(w,grid,col,weight) \
!             [expr round([grid columnconf $p $col -weight])]
!         set vTcl(w,grid,col,width)  \
!             [expr round([grid columnconf $p $col -minsize])]
!         set vTcl(w,grid,row,weight) \
!             [expr round([grid rowconf $p $row -weight])]
!         set vTcl(w,grid,row,width)  \
!             [expr round([grid rowconf $p $row -minsize])]
      }
  }
  
--- 192,209 ----
      }
      if {$mgr == "grid"} {
          set p [winfo parent $target]
!         set pre g
!         set gcolumn $vTcl(w,grid,-column)
!         set grow $vTcl(w,grid,-row)
!         foreach a {column row} {
!             foreach b {weight minsize} {
!                 set num [subst $$pre$a]
!                 if [catch {
!                     set x [expr round([grid ${a}conf $p $num -$b])]
!                 }] {set x 0}
!                 set vTcl(w,grid,$a,$b) $x
!             }
!         }
      }
  }


 -stewart-

Reply via email to