Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22533
Modified Files: Tag: devel_0_39 desire.tk Log Message: fix for console when running in tclsh
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.594 retrieving revision 1.1.2.595 diff -C2 -d -r1.1.2.594 -r1.1.2.595 *** desire.tk 27 Nov 2006 19:37:45 -0000 1.1.2.594 --- desire.tk 27 Nov 2006 20:46:47 -0000 1.1.2.595 *************** *** 5467,5482 **** }
! set console_lines 0 proc post_to_gui {x} { ! global cmdline console_lines ! if {!$cmdline(console)} {puts -nonewline stderr $x; return} set oldpos [lindex [.log.2 get] 1] .log.1 insert end $x regsub -all "\n" $x "" y set n [expr [string length $x]-[string length $y]] ! set console_lines [expr $console_lines+$n] ! while {$console_lines >= $cmdline(console)} { .log.1 delete 1.0 2.0 ! set console_lines [expr $console_lines-1] } if {$oldpos > 0.9999} {.log.1 see end} --- 5467,5482 ---- }
! set ::console_lines 0 proc post_to_gui {x} { ! global ::console_lines ! if {!$::cmdline(console)} {puts -nonewline stderr $x; return} set oldpos [lindex [.log.2 get] 1] .log.1 insert end $x regsub -all "\n" $x "" y set n [expr [string length $x]-[string length $y]] ! incr ::console_lines $n ! while {$::console_lines >= $::cmdline(console)} { .log.1 delete 1.0 2.0 ! incr console_lines -1 } if {$oldpos > 0.9999} {.log.1 see end} *************** *** 7422,7425 **** --- 7422,7426 ---- set window_list [list $main] } else { + set cmdline(console) 0 package require tclreadline ::tclreadline::Loop