質問編集履歴
6
コードの編集
test
CHANGED
File without changes
|
test
CHANGED
@@ -100,8 +100,6 @@
|
|
100
100
|
|
101
101
|
text:'Success'
|
102
102
|
|
103
|
-
'''
|
104
|
-
|
105
103
|
以下変更後のコードを追記します。(ちゃんと動きます。)
|
106
104
|
|
107
105
|
from kivy.app import App
|
@@ -185,3 +183,5 @@
|
|
185
183
|
text:'Success'
|
186
184
|
|
187
185
|
size_hint:[0.2,0.2]
|
186
|
+
|
187
|
+
```
|
5
コードの編集
test
CHANGED
File without changes
|
test
CHANGED
@@ -100,6 +100,8 @@
|
|
100
100
|
|
101
101
|
text:'Success'
|
102
102
|
|
103
|
+
'''
|
104
|
+
|
103
105
|
以下変更後のコードを追記します。(ちゃんと動きます。)
|
104
106
|
|
105
107
|
from kivy.app import App
|
@@ -183,5 +185,3 @@
|
|
183
185
|
text:'Success'
|
184
186
|
|
185
187
|
size_hint:[0.2,0.2]
|
186
|
-
|
187
|
-
'''
|
4
コードの編集
test
CHANGED
File without changes
|
test
CHANGED
@@ -100,10 +100,6 @@
|
|
100
100
|
|
101
101
|
text:'Success'
|
102
102
|
|
103
|
-
```
|
104
|
-
|
105
|
-
|
106
|
-
|
107
103
|
以下変更後のコードを追記します。(ちゃんと動きます。)
|
108
104
|
|
109
105
|
from kivy.app import App
|
@@ -187,3 +183,5 @@
|
|
187
183
|
text:'Success'
|
188
184
|
|
189
185
|
size_hint:[0.2,0.2]
|
186
|
+
|
187
|
+
'''
|
3
コードの編集
test
CHANGED
File without changes
|
test
CHANGED
@@ -101,3 +101,89 @@
|
|
101
101
|
text:'Success'
|
102
102
|
|
103
103
|
```
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
以下変更後のコードを追記します。(ちゃんと動きます。)
|
108
|
+
|
109
|
+
from kivy.app import App
|
110
|
+
|
111
|
+
from kivy.uix.floatlayout import FloatLayout
|
112
|
+
|
113
|
+
from kivy.uix.label import Label
|
114
|
+
|
115
|
+
from kivy.uix.button import Button
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
class MyLayout(FloatLayout):
|
120
|
+
|
121
|
+
def on_touch_down(self,touch):
|
122
|
+
|
123
|
+
make_button=MakeButton()
|
124
|
+
|
125
|
+
self.add_widget(make_button)
|
126
|
+
|
127
|
+
make_button.pos=touch.pos
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
class MyLabel(Label):
|
132
|
+
|
133
|
+
pass
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
class MyButton(Button):
|
138
|
+
|
139
|
+
pass
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
class MakeButton(Button):
|
144
|
+
|
145
|
+
pass
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
class TameshiApp(App):
|
150
|
+
|
151
|
+
def build(self):
|
152
|
+
|
153
|
+
layout=MyLayout()
|
154
|
+
|
155
|
+
myl=MyLabel()
|
156
|
+
|
157
|
+
myb=MyButton()
|
158
|
+
|
159
|
+
layout.add_widget(myl)
|
160
|
+
|
161
|
+
layout.add_widget(myb)
|
162
|
+
|
163
|
+
return layout
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
TameshiApp().run()
|
168
|
+
|
169
|
+
-----------
|
170
|
+
|
171
|
+
<MyLabel>:
|
172
|
+
|
173
|
+
text:'Label'
|
174
|
+
|
175
|
+
pos:100,100
|
176
|
+
|
177
|
+
<MyButton>:
|
178
|
+
|
179
|
+
text:'Button'
|
180
|
+
|
181
|
+
pos:200,200
|
182
|
+
|
183
|
+
size_hint:[0.2,0.2]
|
184
|
+
|
185
|
+
<MakeButton>:
|
186
|
+
|
187
|
+
text:'Success'
|
188
|
+
|
189
|
+
size_hint:[0.2,0.2]
|
2
コードの編集
test
CHANGED
File without changes
|
test
CHANGED
@@ -52,7 +52,7 @@
|
|
52
52
|
|
53
53
|
def __init__(self,*kwargs):
|
54
54
|
|
55
|
-
super(M
|
55
|
+
super(MakeButton,self).__init__(*kwargs)
|
56
56
|
|
57
57
|
self.x=None #?????????
|
58
58
|
|
1
コードの編集
test
CHANGED
File without changes
|
test
CHANGED
@@ -38,13 +38,7 @@
|
|
38
38
|
|
39
39
|
class MyLabel(Label,MyWidget):
|
40
40
|
|
41
|
-
def __init__(self,*kwargs):
|
42
|
-
|
43
|
-
|
41
|
+
pass
|
44
|
-
|
45
|
-
self.x=None #?????????
|
46
|
-
|
47
|
-
self.y=None #?????????
|
48
42
|
|
49
43
|
|
50
44
|
|
@@ -56,7 +50,13 @@
|
|
56
50
|
|
57
51
|
class MakeButton(Button,MyWidget):
|
58
52
|
|
53
|
+
def __init__(self,*kwargs):
|
54
|
+
|
59
|
-
pass
|
55
|
+
super(MyLabel,self).__init__(*kwargs)
|
56
|
+
|
57
|
+
self.x=None #?????????
|
58
|
+
|
59
|
+
self.y=None #?????????
|
60
60
|
|
61
61
|
|
62
62
|
|