Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26057
Modified Files: Tag: desiredata desire.tk Log Message: fixed centipixels
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.600.2.162 retrieving revision 1.1.2.600.2.163 diff -C2 -d -r1.1.2.600.2.162 -r1.1.2.600.2.163 *** desire.tk 11 Jan 2007 18:13:30 -0000 1.1.2.600.2.162 --- desire.tk 11 Jan 2007 18:28:21 -0000 1.1.2.600.2.163 *************** *** 31,35 **** # this command rebuilds the package index: echo pkg_mkIndex . | tclsh
! set debug 0
if {[catch {winfo children .}]} {set tk 0} {set tk 1} --- 31,35 ---- # this command rebuilds the package index: echo pkg_mkIndex . | tclsh
! set debug 1
if {[catch {winfo children .}]} {set tk 0} {set tk 1} *************** *** 45,49 **** if {$tk} {package require bgerror} catch {package require Tclx} ! #if {[catch {source profile_dd.tcl}]} {error_dump} if {[file exists debug.tcl]} {source debug.tcl}
--- 45,49 ---- if {$tk} {package require bgerror} catch {package require Tclx} ! #if {[catch {source /home/matju/src/pd-desiredata/pd/src/profile_dd.tcl}]} {error_dump} if {[file exists debug.tcl]} {source debug.tcl}
*************** *** 5385,5388 **** --- 5385,5390 ---- class_new Slider {BlueBox}
+ # in sliders, @value is the kind of value that goes thru inlets and outlets + # whereas @val is always measured in "centipixels" (unzoomed). def Slider reinit {mess} { super $mess *************** *** 5392,5400 **** vsl {set @orient 1} } }
def Slider init {mess} { super $mess ! set @value 0 }
--- 5394,5409 ---- vsl {set @orient 1} } + $self update_value + } + + def Slider update_value {} { + set span [expr {$@max-$@min}] + set l [expr $@orient ?$@h:$@w] + set @value [expr $@val*$span/($l-1)/100] }
def Slider init {mess} { super $mess ! $self update_value }
*************** *** 5411,5415 **** mset {x1 y1 x2 y2} [$self bbox] set l [expr $@orient ?$@h:$@w] ! set span [expr $@max-$@min] set color [$self look bg] set scaled [expr {$@value*($l-1)/$span}] --- 5420,5424 ---- mset {x1 y1 x2 y2} [$self bbox] set l [expr $@orient ?$@h:$@w] ! set span [expr {$@max-$@min}] set color [$self look bg] set scaled [expr {$@value*($l-1)/$span}] *************** *** 5433,5439 **** super $self draw_knob ! #set value [expr $@val*$span/($l-1)/100] ! # why is there both @val and @value again? ! set @value $@val }
--- 5442,5446 ---- super $self draw_knob ! $self update_value }