I didn´t understand...something is wrong. Example:
from kivy.app import App
from kivy.uix.scatter import Scatter
from kivy.uix.label import Label
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.relativelayout import RelativeLayout
from kivy.uix.textinput import TextInput
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.widget import Widget
from kivy.uix.button import Button
from kivy.properties import ListProperty, ObjectProperty, StringProperty, DictProperty
class Second(RelativeLayout):
ptos = ObjectProperty([])
ptos = [0,0,1000,0,1000,500,0,500]
class First(BoxLayout):
pass
class TestApp(App):
def build(self):
return First()
if __name__ == "__main__":
TestApp().run()
And Kivy file:
<Second>:
Scatter:
do_rotation: False
canvas:
Color:
rgba: 0,0,1,1
Line:
points: root.ptos
close: True
Line:
circle: 50,50,15
<First>:
orientation: 'vertical'
Button:
size_hint: 1, 0.1
text: 'testando 123'
BoxLayout:
orientation: 'horizontal'
Button:
size_hint: 0.1, 1
text: 'funciona'
Second:
pos: self.pos
Button:
size_hint: 0.1, 1
text: 'qwerty'
Button:
size_hint: 1, 0.1
text: 'inferior'
For me it´s clear when to use root.variable. What I´m trying to do is to add some circle from Python because the number of circles, position (X, Y) and diameter are variables...
How to correctly reference the Second widget and add some circle from Python.
The id: is only for reference inside de widget, and I couldn´t use self.ids inside the Second class.