-foregroundはボタンの文字の色。
-backgroundはボタンの背景の色。
-activeforegroundはマウスがボタンの上に来た時の文字の色。
-activebackgroundはマウスがボタンの上に来た時の背景色。
#!/usr/bin/wish
button .b1 -text button1 -borderwidth 4 -foreground white -background dimgray -activeforeground black -activebackground gray
button .b2 -text button2 -borderwidth 4 -foreground white -background dimgray
pack .b1 .b2
通常の表示では変わりは分からないけど・・・。
マウスをボタンの上に載せると(マウスカーソルが表示されていないけど)ボタンの色が変わるようになっている。
デフォルトの状態だと白いような色で統一されているけど、好きな色に自分で設定できるということ。
Tkコマンド【目次】