Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22435
Modified Files: Tag: devel_0_39 desire.tk Log Message: fixed the objectbox size bug and stuff
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.91 retrieving revision 1.1.2.92 diff -C2 -d -r1.1.2.91 -r1.1.2.92 *** desire.tk 1 Nov 2005 02:08:53 -0000 1.1.2.91 --- desire.tk 1 Nov 2005 14:24:16 -0000 1.1.2.92 *************** *** 992,997 **** $c itemconfigure ${self}BASE -outline $frcol -dash \ [if {$@valid} {list 8 8 8 8} {list}] ! #super $canvas ! textbox_draw $self $canvas textbox_edit $self $canvas catch {$c raise ${self}TEXT $self} --- 992,996 ---- $c itemconfigure ${self}BASE -outline $frcol -dash \ [if {$@valid} {list 8 8 8 8} {list}] ! super $canvas textbox_edit $self $canvas catch {$c raise ${self}TEXT $self} *************** *** 1050,1054 **** if {$@edit} { set t .x$canvas.c.${self}text ! $t configure -width [expr [string length $@text]+1] } { item $self $canvas TEXT text [l+ {2 2} [list $x1 $y1]] \ --- 1049,1053 ---- if {$@edit} { set t .x$canvas.c.${self}text ! $t configure -width [expr [string length $@text]] } { item $self $canvas TEXT text [l+ {2 2} [list $x1 $y1]] \ *************** *** 1074,1079 **** -bg ${look(objectbg)} -borderwidth 0 \ -font [format -*-courier-medium--normal--%d-* $font(size)] ! bind $t <Key> "text_key $self $canvas %W %x %y %K %A 0" ! bind $t <Control-Return> "text_key $self $canvas %W %x %y 10 %A 0" bind $t <Return> "$self unedit $canvas" set t .x$canvas.c.${self}text --- 1073,1078 ---- -bg ${look(objectbg)} -borderwidth 0 \ -font [format -*-courier-medium--normal--%d-* $font(size)] ! bind $t <Key> "$self key $canvas %W %x %y %K %A 0" ! bind $t <Control-Return> "$self key $canvas %W %x %y 10 %A 0" bind $t <Return> "$self unedit $canvas" set t .x$canvas.c.${self}text *************** *** 1086,1095 **** }
! def* text key {canvas widget x y key iso shift} { ! # after 0 "global _ ! set @text [$widget get 1.0 1.end] ! $self update_size ! $self draw $canvas ! # " }
--- 1085,1097 ---- }
! def* textbox key {canvas widget x y key iso shift} { ! after 1 "$self after_key $canvas $widget" ! } ! ! def* textbox after_key {canvas widget} { ! set @text [$widget get 1.0 end] ! post "@text is '%s'" $@text ! $self update_size ! $self draw $canvas }
*************** *** 1130,1134 **** def* textbox update_size {} { global font ! set @xs [expr $font(padx)+$font(width)*([expr [string length $@text]+1]-$@valid)] set @ys [expr $font(pady)+$font(height)] } --- 1132,1136 ---- def* textbox update_size {} { global font ! set @xs [expr $font(padx)+$font(width)*([expr [string length $@text]]-$@valid)] set @ys [expr $font(pady)+$font(height)] } *************** *** 1909,1942 **** } if {![info exists _($x:_class)]} { ! post "class=%s" $class if {[info exists classinfo($class)]} { - post BLAH set _($x:_class) [lindex $classinfo($class) 0] } { - post BLEH set _($x:_class) objectbox } $x init - puts "_($x:_class)=$_($x:_class)" - #if {[info exists _($x:canvas)]} { - # hack - # set canvas $_($x:canvas) - # if {![info exists _($canvas:action)]} { - #puts "!!!!!! $canvas not initd !!!!!" - # $canvas init - # } - # if {![info exists _($x:cx)]} { - # set _($x:cx) [lindex $d 2] - # set _($x:cy) [lindex $d 3] - # } - # $x init - # set _($x:text) [lrange $d $i end] - # set _($x:valid) 0 - # $x update_size - # $x draw $canvas - # if {[string length $_($x:text)]==0} {$x edit $canvas} - # set _($_($x:canvas):selection) $x - #} } if {![info exists fields($class)]} {set class obj} #puts "${class} $x = $d" --- 1911,1936 ---- } if {![info exists _($x:_class)]} { ! # new object if {[info exists classinfo($class)]} { set _($x:_class) [lindex $classinfo($class) 0] } { set _($x:_class) objectbox } $x init } + #if {![info exists _($x:cx)]} { + # set _($x:cx) [lindex $d 2] + # set _($x:cy) [lindex $d 3] + #} + switch -- _($x:_class) { + objectbox { + set _($x:text) [lrange $d $i end] + set _($x:valid) 0 + $x update_size + } + } + # $x draw $canvas + # if {[string length $_($x:text)]==0} {$x edit $canvas} + # set _($_($x:canvas):selection) $x if {![info exists fields($class)]} {set class obj} #puts "${class} $x = $d" *************** *** 3034,3039 **** #c lsort proably does what u want (has an integer flag too)
- - post %s hello set manager [manager_new] - post %s hello --- 3028,3030 ----