Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4216
Modified Files: Tag: desiredata desire.tk Log Message: accepting and playing back macro sent from [macro]
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.600.2.319 retrieving revision 1.1.2.600.2.320 diff -C2 -d -r1.1.2.600.2.319 -r1.1.2.600.2.320 *** desire.tk 8 Aug 2007 18:40:39 -0000 1.1.2.600.2.319 --- desire.tk 8 Aug 2007 21:12:36 -0000 1.1.2.600.2.320 *************** *** 1356,1359 **** --- 1356,1360 ---- def View draw {} {}
+ #def View delete {} {if {[[$self class] <= Box]} {$self erase}; super} def View delete {} {$self erase; super} def View erase {} {$self item_delete} *************** *** 1697,1701 **** set @pixsize {0 0} set @margin {0 0} ! #set @grid 1 }
--- 1698,1703 ---- set @pixsize {0 0} set @margin {0 0} ! set @macro_q {} ! set @macro_delay 200 }
*************** *** 4989,4995 ****
def Canvas macro_event_append {e} { ! puts "check if the q is empty" ! puts "event::: $e" } #-----------------------------------------------------------------------------------# class_new Wire {View} --- 4991,5022 ----
def Canvas macro_event_append {e} { ! if {![llength $@macro_q]} {after $@macro_delay [list $self macro_schedule $@macro_delay]} ! lappend @macro_q $e } + + def Canvas macro_schedule {delay} { + if {[llength $@macro_q]} { + set w [focus] + set m [lindex $@macro_q 0] + set fudge_motion 0 + mset {event x y mode k} $m + switch $event { + KeyPress {set name [modekey $k $mode]; set fudge_motion 1} + ButtonPress {set name $event-$k; set fudge_motion 1} + ButtonRelease {set name $event-$k; set fudge_motion 1} + Motion {set name $event} + default {puts "Error: this event should not have been here.."} + } + if {$fudge_motion} {event generate $w <Motion> -x $x -y $y} + event generate $w <$name> -x $x -y $y + if {$event=="KeyPress"} {event generate $w <KeyRelease-$k> -x $x -y $y} + set @macro_q [lreplace $@macro_q 0 0] + after $delay [list $self macro_schedule $@macro_delay] + } + } + + def Canvas foobar {} {$self macro_schedule 1000} + + def Canvas macro_q {} {puts "$@macro_q"} #-----------------------------------------------------------------------------------# class_new Wire {View}