OUTPUT BUFFER:
#!/usr/local/bin/tclsh package require Tk package require tclordalie source /home/moumou/ordali/src/ordali_sequence.tcl proc ContenuDuFichier {{Fichier ""}} { if { $Fichier == "" } {return ""} set f [open $Fichier r] set Texte [read -nonewline $f] close $f return $Texte } proc LesLignesDuFichier {{Fichier ""}} { return [split [ContenuDuFichier $Fichier] "\n"] } set LignesCoul ">seqlab I white magenta L white magenta M white magenta V white magenta ILMV white magenta R white blue K white blue RK white blue F white red Y white red W white red FYW white red D white forestgreen E white forestgreen DE white forestgreen Q white green P white black G black orange H black cyan N black cyan HN white cyan S white darkviolet T white darkviolet A white darkviolet C white darkviolet STAC white darkviolet SPC white darkslategrey . black darkslategrey " proc ConfTag {} { global Lgaa Lfreg wt LignesCoul foreach c [lrange [split $LignesCoul "\n"] 1 end] { lassign [split $c] n f b $wt tag configure $n -foreground $f -background $b } if {0} { set Lgaa [list STAC DE ILMV FYW P RK Q G HN] foreach g $Lgaa { set freg [join [split $g ""] "|"] lappend Lfreg $freg } } return } set wt .t grid [text .t -wrap none] [scrollbar .sy -orient vertical -command yset] -sticky ewns grid [scrollbar .sx -orient horizontal -command xset] -sticky ew grid rowconfigure . 0 -weight 1 grid columnconfigure . 0 -weight 1 ConfTag set dta {} if {0} { set nx 10000 set ny 5000 for {set i 0} {$i < $ny} {incr i} { set l {} for {set j 0} {$j < $nx} {incr j} { set c [lindex {a b c d e f g h i j k l} [expr {int(rand()*10)}]] lappend l $c $c } lappend dta $l } set f [open LM.DAT w] puts $f [join $dta \n] close $f } if {0} { set f [open LM.DAT r] set dta [split [read $f] \n] close $f } proc xset {cmd n {unit ""}} { global x nx wx switch -exact -- $cmd { scroll { switch -exact -- $unit { units { incr x $n } pages { incr x [expr {$n*$wx}] } } } moveto { set x [expr {int($n*$nx)}] } } if {$x < 0} { set x 0 } if {$x+$wx > $nx} { set x [expr {$nx-$wx}] } adjust } proc yset {cmd n {unit ""}} { global y ny wy switch -exact -- $cmd { scroll { switch -exact -- $unit { units { incr y $n } pages { incr y [expr {$n*$wy}] } } } moveto { set y [expr {int($n*$ny)}] } } if {$y < 0} { set y 0 } if {$y+$wy > $ny} { set y [expr {$ny-$wy}] } adjust } proc adjust {} { global x y dta nx ny wx wy .t delete 1.0 end if {1} { .t insert end {*}[Ccode_AskSeqView $x [expr {$x+$wx}] $y [expr {$y+$wy}]] } else { set R [list] for {set i $y} {$i < $y+$wy} {incr i} { set l [lindex $dta $i] lappend R {*}[lrange $l [expr {$x*2}] [expr {($x+$wx)*2-1}]] "\n" "" } .t insert end {*}$R } .sx set [expr {double($x)/$nx}] [expr {double($x+$wx-1)/$nx}] .sy set [expr {double($y)/$ny}] [expr {double($y+$wy-1)/$ny}] return } proc JunkData {} { global nx ny dta set Lc [list A C D E F G H I K L M N P Q R S T V W Y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .] set nv [llength $Lc] for {set i 0} {$i < $ny} {incr i} { set l [list] for {set j 0} {$j < $nx} {incr j} { set c [lindex $Lc [expr {int(rand()*$nv)}]] #lappend l $c $c lappend l $c } lappend dta $l } return } if {0} { DecortiqueUnTFA ttl.tfa Lnom Seq DonneMemeLongueur Seq foreach n $Lnom { set s [set Seq($n)] lappend LSV $s set l {} set Ls [split $s ""] foreach e $Ls { lappend l $e $e } lappend dta $l } set ny [llength $Lnom] set nx [string length [lindex $Seq([lindex $Lnom 1])]] Ccode_InitSeqView $LSV } else { set nx 5000 set ny 300 JunkData if {1} { foreach l $dta { lappend Res [join $l ""] } Ccode_InitSeqView $Res } } set wx 150 set wy 30 .t configure -height $wy .t configure -width $wx set x 0 set y 0 puts "on y va !" ; flush stdout adjust set stepx [expr {($nx-$wx)/10}] puts "pour X" for {set i 1} {$i < 10} {incr i} { puts "[time {xset scroll $stepx units}]" } puts "Pour Y" for {set i 1} {$i < 10} {incr i} { puts "[time {yset scroll $stepx units}]" }