Tkコマンド【-justify】 | ..あちゃ! no mic's

..あちゃ! no mic's

クラウドファンディング予定~2026年度
何度でもチャレンジ!
ただいまソーラーピックアップのテスト中

SANTA no Mix

-justifyは複数行にわたるテキストをleftで左寄せ、centerで中央揃え、rightで右寄せにする。
\nは改行のしるし。
全角かな、英数を間違えないように。

#!/usr/bin/wish
label .l1 -text "-justifyの\n左寄せの\nテキスト表示です" -justify left \
-bg orange4 -fg white -relief sunken -bd 4
label .l2 -text "-justifyの\n中揃えの\nテキスト表示です" -justify center \
-bg purple4 -fg white -relief sunken -bd 4
label .l3 -text "-justifyの\n右寄せの\nテキスト表示です" -justify right \
-bg cyan4   -fg white -relief sunken -bd 4
pack .l1 .l2 .l3 -side left