Why can't I access the Screen.ids?
kv rules are not applied until the original Widget
has finished instantiating. In this case, your Manager
widget is the initial widget - it, in turn, creates the other widgets including RootWidget
. This means that in your RootWidget.__init__
the ids
are not yet populated! They will be as soon as Manager
finishes instantiating - so the best approach is to just delay the rest of your initialization, like so:
class RootWidget(Screen):
def __init__(self, **kwargs):
super(RootWidget, self).__init__(**kwargs)
Clock.schedule_once(self._finish_init)
def _finish_init(self, dt):
self.grid = self.ids.grid
# etc