[PD-cvs] pd/src desire.tk,1.1.2.150,1.1.2.151

chunlee chunlee at users.sourceforge.net
Wed Apr 12 17:41:55 CEST 2006


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

Modified Files:
      Tag: devel_0_39
	desire.tk 
Log Message:
first attempt in making a config file for the $look


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.150
retrieving revision 1.1.2.151
diff -C2 -d -r1.1.2.150 -r1.1.2.151
*** desire.tk	10 Apr 2006 23:39:49 -0000	1.1.2.150
--- desire.tk	12 Apr 2006 15:41:53 -0000	1.1.2.151
***************
*** 544,548 ****
  def client open_file {} {
      global pd_opendir
!     set filename [tk_getOpenFile -defaultextension .pd \
      	-filetypes { {{pd files} {.pd}} {{max files} {.pat}}} \
          -initialdir $pd_opendir]
--- 544,548 ----
  def client open_file {} {
      global pd_opendir
!     set hname [tk_getOpenFile -defaultextension .pd \
      	-filetypes { {{pd files} {.pd}} {{max files} {.pat}}} \
          -initialdir $pd_opendir]
***************
*** 681,684 ****
--- 681,686 ----
  set look(iowidth) 7
  set look(iopos) 0
+ set look(inletfg) #ff0000
+ set look(outletfg) #ff0000
  set look(objectfg) #000000
  set look(objectbg) #ffffff
***************
*** 689,698 ****
  set look(canvasbgrun) #ffffff
  set look(canvasbgedit) #dddddd
  set look(wirefg) #888888
  set look(wirefg2) #ee0000
  set look(sliderbg) #ccebff
  #set look(sliderbg) #ffeedd
! set look(inletfg) #ff0000
! set look(outletfg) #ff0000
  set look(extrapix) [switch $OS {
          osx     {concat 2}
--- 691,702 ----
  set look(canvasbgrun) #ffffff
  set look(canvasbgedit) #dddddd
+ set look(selrect) #ff12ff
  set look(wirefg) #888888
  set look(wirefg2) #ee0000
+ set look(wirethick) 1
+ set look(wiredash) #ee0012
  set look(sliderbg) #ccebff
  #set look(sliderbg) #ffeedd
! 
  set look(extrapix) [switch $OS {
          osx     {concat 2}
***************
*** 701,704 ****
--- 705,745 ----
  
  #-----------------------------------------------------------------------------------#
+ proc read_ddrc {} {
+ 	global look
+ 	set file [open "~/.ddrc" "RDONLY CREAT"]
+ 	set dd_config [read $file]
+ 	close $file
+ 	
+ 	set lines [split $dd_config "\n"]
+ 	foreach line $lines {
+ 		# comments begins with "#", and is skipped 
+ 		if {[regexp {^#} $line comment]} {} else {
+ 		
+ 		  if {[regexp {^-[a-zA-Z]{2,10}} $line option]} {
+ 		
+ 		  foreach {word1 word2 word3} $line {
+ 		  puts "word:: $word1 | $word2 | $word3"
+ 		  set word1 [string replace $word1 0 0]
+ 		  
+ 		  switch $word1 {
+ 		  look {
+ 		  set look($word2) $word3
+ 		  puts "look($word2) $word3"
+ 		  } 
+ 		  font {
+ 		  puts "settings for font"
+ 		  } 
+ 		  default {
+ 		  puts "settings for something"
+ 		  } 
+ 	      }
+ 		  
+ 		  }
+ 		}
+ 		}
+ 	}
+ }
+ read_ddrc
+ #-----------------------------------------------------------------------------------#
  set pd_apilist "{ALSA 1}"
  
***************
*** 1730,1733 ****
--- 1771,1775 ----
  
  def* canvas clickedit {x y b f} {
+ 	global look
  	set c .[$self canvas].c
  	mset {type id} [$self identify_target $x $y $b $f "click"]
***************
*** 1740,1744 ****
  		set @action rect
  		$c create line $x $y $x $y $x $y $x $y $x $y \
! 			-tags {selrect1 selrect} -fill black -dash {3 3 3 3} -dashoffset 3
  		return
  	}
--- 1782,1786 ----
  		set @action rect
  		$c create line $x $y $x $y $x $y $x $y $x $y \
! 			-tags {selrect1 selrect} -fill black -dash {3 3 3 3} -dashoffset 3 -fill $look(selrect)
  		return
  	}
***************
*** 1763,1767 ****
  		set out [expr int(($x-$x1)*$outs/($x2-$x1))]
  		mset {x1 y1 x2 y2} [$c bbox ${id}o${out}]
! 		$c create line  [expr ($x1+$x2)/2] [expr ($y1+$y2)/2] $x $y -dash {4 4 4 4} -tags lnew
  		set @wire_from [list $id $out]
  		set @action wire
--- 1805,1809 ----
  		set out [expr int(($x-$x1)*$outs/($x2-$x1))]
  		mset {x1 y1 x2 y2} [$c bbox ${id}o${out}]
! 		$c create line  [expr ($x1+$x2)/2] [expr ($y1+$y2)/2] $x $y -dash {4 4 4 4} -tags lnew -fill $look(wiredash)
  		set @wire_from [list $id $out]
  		set @action wire
***************
*** 1870,1873 ****
--- 1912,1923 ----
        }
        move {
+       	puts "something moved ::: $@selection"
+ 	
+ 	#foreach obj $@selection {
+ 	##this could be wrong....
+ 	#mset {x y} [$obj xy]
+ 	#pd .$self object_moveto !$obj $x $y
+ 	#}
+ 	
          #puts "....select_by:$@select_by"
          #if {$@select_by == "click"} {
***************
*** 2067,2071 ****
  	set p $self$type$port
  	set outline [switch $type {i {concat $look(outletfg)} o {concat $look(inletfg)}}]
! 	$c create rectangle [l+ [$c coords $p] {-4 -4 +4 +4}] -outline $outline -width 1 -tags ${p}b
  	switch $type {i {set tip "inlet $port"} o {set tip "outlet $port"}}
  	$@canvas show_tooltip $x $y $tip
--- 2117,2121 ----
  	set p $self$type$port
  	set outline [switch $type {i {concat $look(outletfg)} o {concat $look(inletfg)}}]
! 	$c create rectangle [l+ [$c coords $p] {-4 -4 +4 +4}] -outline $outline -width 1 -tags ${p}b -fill
  	switch $type {i {set tip "inlet $port"} o {set tip "outlet $port"}}
  	$@canvas show_tooltip $x $y $tip
***************
*** 2098,2102 ****
  def* wire draw {} {
  	global look
! 	set thick 2
  	puts "------- from:$@obj1 outlet:$@port1 to:$@obj2 inlet:$@port2"
  	set bbox1 [.$@canvas.c bbox [join [list "$@obj1" o "$@port1"] ""]]
--- 2148,2152 ----
  def* wire draw {} {
  	global look
! 	#set thick 2
  	puts "------- from:$@obj1 outlet:$@port1 to:$@obj2 inlet:$@port2"
  	set bbox1 [.$@canvas.c bbox [join [list "$@obj1" o "$@port1"] ""]]
***************
*** 2109,2112 ****
--- 2159,2163 ----
  	set xys [list $x1 $y1 $x2 $y2]
  	set length [expr sqrt(pow($x2-$x1,2)+pow($y2-$y1,2))]
+ 	# how to customise the arrow size/shape? 
  	set arrowsize [expr $length<100 ? $length/10 : 10]
  	if {$arrowsize < 5} {set arrow none} {set arrow last}
***************
*** 2115,2119 ****
  	if {$@select_by == "selrect"} {set wire_color $look(wirefg2)} {set wire_color $look(wirefg)}
  	#set wire_color $look(wirefg)
! 	$self item WIRE line $xys -width $thick -smooth yes \
  		-arrow $arrow -arrowshape $arrowshape -fill $wire_color
  	
--- 2166,2170 ----
  	if {$@select_by == "selrect"} {set wire_color $look(wirefg2)} {set wire_color $look(wirefg)}
  	#set wire_color $look(wirefg)
! 	$self item WIRE line $xys -width $look(wirethick) -smooth yes \
  		-arrow $arrow -arrowshape $arrowshape -fill $wire_color
  	
***************
*** 3415,3416 ****
--- 3466,3468 ----
  post_hierarchy thing
  
+ 





More information about the Pd-cvs mailing list