[PD-cvs] pd/src desire.tk,1.1.2.600.2.106,1.1.2.600.2.107
chunlee
chunlee at users.sourceforge.net
Tue Dec 19 02:55:58 CET 2006
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12957
Modified Files:
Tag: desiredata
desire.tk
Log Message:
reintroduce focus= for TextBox, AtomBox has its own def unedit
Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.600.2.106
retrieving revision 1.1.2.600.2.107
diff -C2 -d -r1.1.2.600.2.106 -r1.1.2.600.2.107
*** desire.tk 19 Dec 2006 01:49:10 -0000 1.1.2.600.2.106
--- desire.tk 19 Dec 2006 01:55:54 -0000 1.1.2.600.2.107
***************
*** 2161,2165 ****
bind $t <Return> "$self unedit"
bind $t <Escape> "$self unedit 0"
! bind $t <FocusOut> "$self unedit"
mset {cx cy} [$self xy]
$self item text window [l+ $@textoffset [$self xy]] \
--- 2161,2166 ----
bind $t <Return> "$self unedit"
bind $t <Escape> "$self unedit 0"
! #bind $t <FocusOut> "$self unedit"
! $@canvas focus= $self
mset {cx cy} [$self xy]
$self item text window [l+ $@textoffset [$self xy]] \
***************
*** 2374,2377 ****
--- 2375,2379 ----
if {[winfo exists .completion]} {$@action cancel}
focus $c
+ $@canvas focus= ""
}
***************
*** 3370,3373 ****
--- 3372,3376 ----
def Canvas click_on_nothing {f target x y} {
+ if {$@focus != ""} {if {[[$@focus class] <= TextBox]} {$@focus unedit}}
if {![expr $f&255]} {
$self deselect_all
***************
*** 4892,4898 ****
}
def AtomBox unedit {{accept 1}} {
if {!$@edit} {return}
! super
}
--- 4895,4919 ----
}
+ #def AtomBox unedit {{accept 1}} {
+ # if {!$@edit} {return}
+ # super
+ #}
+
def AtomBox unedit {{accept 1}} {
if {!$@edit} {return}
! set @edit 0; $self changed edit
! set c [$@canvas widget]
! set t $c.${self}text
! if {$accept} {
! set val [$t get 1.0 "end - 1 chars"]
! if {![regexp {[a-zA-Z]} $val]} {
! set @val $val
! set @text $val; #quick hack so that TextBox draw picks up the changes
! }
! $self apply_value
! }
! after 1 "destroy $t"
! focus $c
! $@canvas focus= ""
}
***************
*** 5874,5877 ****
--- 5895,5899 ----
$@textbox delete 1.0 1.end
$@textbox insert 1.0 $class
+
$obj unedit
destroy .$self
More information about the Pd-cvs
mailing list