09/09/29 21:03:35
package require Tk
text .txt -font {"MS Gothic" 12}
button .b1 -text 4tab -command {settab 4}
button .b2 -text 8tab -command {settab 8}
pack .txt -side bottom
pack .b1 .b2 -side left
proc settab {n} {
set font [.txt cget -font]
.txt configure \
-tabstyle wordprocessor \
-tabs "[expr {$n * [font measure $font 0]}] left"
}
.txt insert 0.0 {
12345678901234567890123456789012345678901234567890
#include <stdio.h>
int main(int argc, const char** argv) {
printf();
return 0;
}
}