質問編集履歴
1
追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -87,4 +87,27 @@
|
|
87
87
|
```
|
88
88
|
|
89
89
|
エラー
|
90
|
-
_tkinter.TclError: unknown option "-command"
|
90
|
+
_tkinter.TclError: unknown option "-command"
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
#解糖を受けての追記
|
95
|
+
```python
|
96
|
+
def click(event):
|
97
|
+
print('Hello,World')
|
98
|
+
# クリックされた場所に描画する
|
99
|
+
|
100
|
+
import tkinter
|
101
|
+
|
102
|
+
# マップの描画
|
103
|
+
def draw_map():
|
104
|
+
for y in range(0, MAX_HEIGHT):
|
105
|
+
for x in range(0, MAX_WIDTH):
|
106
|
+
p = map_data[y][x]
|
107
|
+
canvas.create_image(x*64+30, y*64+30, image=images[p])
|
108
|
+
#イベントを設定する
|
109
|
+
canvas.bind("<Button-1>", click)
|
110
|
+
|
111
|
+
```
|
112
|
+
|
113
|
+
上記のコードで実行を確認できました。
|