Tk Library Source Code

Artifact [98d56be72e]
Login

Artifact 98d56be72e37f99aa8f4be6a64783cc24b9dc7b3:

Attachment "scrollw.patch" to ticket [472718ffff] added by hobbs 2003-02-26 05:13:37.
Index: scrollw.tcl
===================================================================
RCS file: /cvsroot/tcllib/bwidget/scrollw.tcl,v
retrieving revision 1.5
diff -c -p -r1.5 scrollw.tcl
*** scrollw.tcl	25 Feb 2003 09:51:03 -0000	1.5
--- scrollw.tcl	25 Feb 2003 16:22:24 -0000
*************** proc ScrolledWindow::_set_hscroll { path
*** 200,211 ****
      if {$data(realized) && $data(hsb,present)} {
  	if {$data(hsb,auto)} {
  	    if {$data(hsb,packed) && $vmin == 0 && $vmax == 1} {
! 		set data(hsb,packed) 0
! 		grid remove $path.hscroll
  	    } elseif {!$data(hsb,packed) && ($vmin != 0 || $vmax != 1)} {
  		set data(hsb,packed) 1
  		grid $path.hscroll -column 1 -row $data(hsb,row) \
  			-sticky ew -ipady $data(ipad)
  	    }
  	}
  	$path.hscroll set $vmin $vmax
--- 200,216 ----
      if {$data(realized) && $data(hsb,present)} {
  	if {$data(hsb,auto)} {
  	    if {$data(hsb,packed) && $vmin == 0 && $vmax == 1} {
! 		if { ![info exists data(hlock)] } {
! 		    set data(hsb,packed) 0
! 		    grid remove $path.hscroll
! 		}
  	    } elseif {!$data(hsb,packed) && ($vmin != 0 || $vmax != 1)} {
  		set data(hsb,packed) 1
  		grid $path.hscroll -column 1 -row $data(hsb,row) \
  			-sticky ew -ipady $data(ipad)
+ 		set data(hlock) 1
+ 		update idletasks
+ 		unset data(hlock)
  	    }
  	}
  	$path.hscroll set $vmin $vmax
*************** proc ScrolledWindow::_set_vscroll { path
*** 222,233 ****
      if {$data(realized) && $data(vsb,present)} {
  	if {$data(vsb,auto)} {
  	    if {$data(vsb,packed) && $vmin == 0 && $vmax == 1} {
! 		set data(vsb,packed) 0
! 		grid remove $path.vscroll
  	    } elseif {!$data(vsb,packed) && ($vmin != 0 || $vmax != 1) } {
  		set data(vsb,packed) 1
  		grid $path.vscroll -column $data(vsb,column) -row 1 \
  			-sticky ns -ipadx $data(ipad)
  	    }
  	}
  	$path.vscroll set $vmin $vmax
--- 227,243 ----
      if {$data(realized) && $data(vsb,present)} {
  	if {$data(vsb,auto)} {
  	    if {$data(vsb,packed) && $vmin == 0 && $vmax == 1} {
! 		if { ![info exists data(vlock)] } {
! 		    set data(vsb,packed) 0
! 		    grid remove $path.vscroll
! 		}
  	    } elseif {!$data(vsb,packed) && ($vmin != 0 || $vmax != 1) } {
  		set data(vsb,packed) 1
  		grid $path.vscroll -column $data(vsb,column) -row 1 \
  			-sticky ns -ipadx $data(ipad)
+ 		set data(vlock) 1
+ 		update idletasks
+ 		unset data(vlock)
  	    }
  	}
  	$path.vscroll set $vmin $vmax