回答編集履歴

1

edit

2018/01/31 11:38

投稿

mkgrei
mkgrei

スコア8560

test CHANGED
@@ -1 +1,27 @@
1
1
  `def func()`を`model_common.py`に入れてはいかがですか?
2
+
3
+
4
+
5
+ ---
6
+
7
+
8
+
9
+ ```python
10
+
11
+ class Button2:
12
+
13
+ def __init__(self, func=None):
14
+
15
+ if func is not None:
16
+
17
+ self.func = func
18
+
19
+ def push(self):
20
+
21
+ btn2 = tkinter.Button(text="button")
22
+
23
+ btn2.place(x=100, y=0)
24
+
25
+ btn2["command"] = self.func
26
+
27
+ ```