回答編集履歴
1
edit
answer
CHANGED
@@ -1,1 +1,14 @@
|
|
1
|
-
`def func()`を`model_common.py`に入れてはいかがですか?
|
1
|
+
`def func()`を`model_common.py`に入れてはいかがですか?
|
2
|
+
|
3
|
+
---
|
4
|
+
|
5
|
+
```python
|
6
|
+
class Button2:
|
7
|
+
def __init__(self, func=None):
|
8
|
+
if func is not None:
|
9
|
+
self.func = func
|
10
|
+
def push(self):
|
11
|
+
btn2 = tkinter.Button(text="button")
|
12
|
+
btn2.place(x=100, y=0)
|
13
|
+
btn2["command"] = self.func
|
14
|
+
```
|