[PD-cvs] pd/src desire.tk,1.1.2.600.2.310,1.1.2.600.2.311

chunlee chunlee at users.sourceforge.net
Tue Aug 7 18:38:08 CEST 2007


Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1574

Modified Files:
      Tag: desiredata
	desire.tk 
Log Message:
fixed Grid draw so it updated with scrollbars correctly


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.600.2.310
retrieving revision 1.1.2.600.2.311
diff -C2 -d -r1.1.2.600.2.310 -r1.1.2.600.2.311
*** desire.tk	7 Aug 2007 16:21:00 -0000	1.1.2.600.2.310
--- desire.tk	7 Aug 2007 16:38:04 -0000	1.1.2.600.2.311
***************
*** 2,6 ****
  set cvsid {$Id$}
  #-----------------------------------------------------------------------------------#
! #
  # DesireData
  #   Copyright (c) 2004 by Mathieu Bouchard
--- 2,6 ----
  set cvsid {$Id$}
  #-----------------------------------------------------------------------------------#
! # 
  # DesireData
  #   Copyright (c) 2004 by Mathieu Bouchard
***************
*** 1853,1857 ****
  	pack [scrollbar $win.yscroll -command "$c yview"                   ] -side  right -fill y -before $c
  	pack [scrollbar $win.xscroll -command "$c xview" -orient horizontal] -side bottom -fill x -before $c
! 	$c configure -yscrollcommand "$win.yscroll set" -xscrollcommand "$win.xscroll set" \
  	    -scrollregion [list 0 0 $xregion $yregion]
  }
--- 1853,1860 ----
  	pack [scrollbar $win.yscroll -command "$c yview"                   ] -side  right -fill y -before $c
  	pack [scrollbar $win.xscroll -command "$c xview" -orient horizontal] -side bottom -fill x -before $c
! 	#$c configure -yscrollcommand "$win.yscroll set" -xscrollcommand "$win.xscroll set" \
! 	#    -scrollregion [list 0 0 $xregion $yregion]
! 	set xw $win.xscroll; set yw $win.yscroll
! 	$c configure -yscrollcommand "$self scroll_set $yw" -xscrollcommand "$self scroll_set $xw" \
  	    -scrollregion [list 0 0 $xregion $yregion]
  }
***************
*** 2027,2030 ****
--- 2030,2037 ----
  	}
  }
+ 
+ # this allows the grid to update when scroll
+ def Canvas scroll_set {w v1 v2} {if {[$self look gridstate]} {$@grid draw}; $w set $v1 $v2}
+ 
  def Canvas reload {} {
  	netsend [list .$self map 0]
***************
*** 6506,6518 ****
  	set c [$@canvas widget]
  	set lowest [$@canvas lowest_item]
! 	for {set i 1} {$i < $@width} {incr i} {
  		if {![expr $i % $@size]} {
! 			set line [list $i 0 $i $@height]
  			$self item HL$i line $line -fill $@col -width 0.1 -dash {2 2 2 2}
  		}
  	}
! 	for {set i 1} {$i < $@height} {incr i} {
  		if {![expr $i % $@size]} {
! 			set line [list 0 $i $@width $i]
  			$self item VL$i line $line -fill $@col -width 0.1 -dash {2 2 2 2}
  		}
--- 6513,6527 ----
  	set c [$@canvas widget]
  	set lowest [$@canvas lowest_item]
! 	set x1 [$c canvasx 0]; set y1 [$c canvasy 0]
! 	set x2 [expr $x1+$@width]; set y2 [expr $y1+$@height]
! 	for {set i [expr int($x1)]} {$i < $x2} {incr i} {
  		if {![expr $i % $@size]} {
! 			set line [list $i $y1 $i $y2]
  			$self item HL$i line $line -fill $@col -width 0.1 -dash {2 2 2 2}
  		}
  	}
! 	for {set i [expr int($y1)]} {$i < $y2} {incr i} {
  		if {![expr $i % $@size]} {
! 			set line [list $x1 $i $x2 $i]
  			$self item VL$i line $line -fill $@col -width 0.1 -dash {2 2 2 2}
  		}





More information about the Pd-cvs mailing list