Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9624
Modified Files: Tag: devel_0_39 desire.tk Log Message: History's undo and perform should make more sense now.
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.230 retrieving revision 1.1.2.231 diff -C2 -d -r1.1.2.230 -r1.1.2.231 *** desire.tk 12 Jun 2006 09:44:28 -0000 1.1.2.230 --- desire.tk 12 Jun 2006 16:01:54 -0000 1.1.2.231 *************** *** 18,21 **** --- 18,23 ----
if {[catch {source objective.tcl}]} { + puts "error loading objective.tcl: errorcode=$errorCode" + puts "errorInfo=$errorInfo" puts "looking for objective.tcl in $our_tcl_dir" source $our_tcl_dir/objective.tcl *************** *** 182,188 **** set @undo $@redo set @redo {} ! set err [catch {perform backup.pop}] set @redo $@undo ! set @undo $backup if {$err} [error "error during undo"] } --- 184,190 ---- set @undo $@redo set @redo {} ! set err [catch {perform [lindex $backup end]}] set @redo $@undo ! set @undo [lrange $backup 0 end-1] if {$err} [error "error during undo"] } *************** *** 195,203 **** }
! # this traverses a tree and runs all the restore operations. ! #!@#$ could I use #flatten! now ? ! def History perform {mess} { $self atomically { ! foreach x [lreverse $mess] {$mess call} } } --- 197,204 ---- }
! # run all actions in an undo. ! def History perform {actions} { $self atomically { ! foreach x [lreverse $actions] {eval $actions} } } *************** *** 3912,3916 **** } set i [$listbox curselection] ! set class [lindex [$listbox get $i] 0] $@textbox delete 1.0 1.end $@textbox insert 1.0 $class --- 3913,3918 ---- } set i [$listbox curselection] ! set class [string range [lindex [$listbox get $i] 0] 1 end-1] ! # set class [lindex [$listbox get $i] 0] $@textbox delete 1.0 1.end $@textbox insert 1.0 $class