Мне нужно иметь доступ к идентификатору макетов, чтобы добавить к нему фигуры. Проблема в том, что идентификатор макета всегда меняется. Как мне получить идентификатор, чтобы я мог изменить этот конкретный макет?
код:
can = self.root.get_screen("three")
...
get_score = data.get(key, {}).get('score')
new_pos = can.pos
for x in range(-1, get_score): # had to use -1 to get correct amount of shapes
if x % 10 == 0:
layout = GridLayout(id=str(x), cols=1, size_hint= (None,None))
can.ids.my_box.add_widget(layout)
with can.ids.my_box.ids.x.canvas:
Color(0, 1, 0, .75, mode='rgba')
rect = Rectangle(pos=new_pos, size=(30, 30))
new_pos[0] += rect.size[1]
new_pos[0] += rect.size[0]
for child in can.ids.my_box.children: #used to check how many cols are added
print(child.id)
ошибка: AttributeError: 'super' object has no attribute '__getattr__'