質問編集履歴
1
新たに試したソースコードの追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -64,4 +64,29 @@
|
|
64
64
|
return MyRoot()
|
65
65
|
|
66
66
|
Renshu().run()
|
67
|
+
```
|
68
|
+
|
69
|
+
## 補足(新たに試したコード)
|
70
|
+
※
|
71
|
+
```
|
72
|
+
super(MyRoot, self).__init__(**kwargs)
|
73
|
+
```を使わなかった場合
|
74
|
+
|
75
|
+
```python
|
76
|
+
from kivy.app import App
|
77
|
+
from kivy.uix.boxlayout import BoxLayout
|
78
|
+
from kivy.uix.label import Label
|
79
|
+
|
80
|
+
class MyRoot(BoxLayout):
|
81
|
+
def __init__(self, **kwargs):
|
82
|
+
self.layout = BoxLayout()
|
83
|
+
self.lbl = Label(text='LLL')
|
84
|
+
self.layout.add_widget(self.lbl)
|
85
|
+
|
86
|
+
class Renshu(App):
|
87
|
+
def build(self):
|
88
|
+
L = MyRoot()
|
89
|
+
return L.layout
|
90
|
+
|
91
|
+
Renshu().run()
|
67
92
|
```
|