chiark / gitweb /
ypp-chatlog-alerter: when replacing, always delete the row and shuffle others up
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 3 Oct 2010 23:40:23 +0000 (00:40 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 3 Oct 2010 23:40:23 +0000 (00:40 +0100)
ypp-chatlog-alerter

index fb6bba79d8aae695356c5b96c9303ad0d8d6c086..2f6d86ef2fa934cd7659f472065445a8f15c51d6 100755 (executable)
@@ -270,7 +270,7 @@ puts "MESSAGE $l"
 }
 
 proc message {pirate msg} {
 }
 
 proc message {pirate msg} {
-    global times pirates messages
+    global times pirates messages height
     global lw_ls lw_ws
     
     set ix [lsearch -exact $pirates $pirate]
     global lw_ls lw_ws
     
     set ix [lsearch -exact $pirates $pirate]
@@ -285,6 +285,13 @@ proc message {pirate msg} {
            }
            incr cix
        }
            }
            incr cix
        }
+       for_lw {
+           set $l [lreplace [set $l] $ix $ix]
+           lappend $l {}
+           $w delete $ix
+           $w insert end {}
+       }
+       set ix [expr {$height-1}]
     }
     for_lw new [list $now $pirate $msg] {
        set $l [lreplace [set $l] $ix $ix $new]
     }
     for_lw new [list $now $pirate $msg] {
        set $l [lreplace [set $l] $ix $ix $new]