- 811 名前:デフォルトの名無しさん mailto:sage [2011/11/29(火) 22:33:47.99 ]
- ググってみたけどこんな方法しかないような
wm geometry . 500x500 canvas .c -bg white pack .c -expand 1 -fill both .c create oval 230 230 270 270 -fill red set moveto "" bind . <KeyPress-Up> {set moveto "up"} bind . <KeyPress-Down> {set moveto "down"} bind . <KeyPress-Right> {set moveto "right"} bind . <KeyPress-Left> {set moveto "left"} bind . <KeyRelease> {set moveto ""} proc move {} { global moveto switch $moveto { up { .c move 1 0 -3 } down { .c move 1 0 3 } right { .c move 1 3 0 } left { .c move 1 -3 0 } } after 10 move } after 10 move 方向を一つの変数でまとめてるけど方向別にすれば斜め移動も出来る
|

|