I'm stuck with the following problem:
When I run the following code - this seems to work:
class Board(GridLayout):
def __init__(self, numLines=8, numCols=8, **kwargs):
# constructor of the board
GridLayout._init_(self, **kwargs)
self.finish_game = Button()
# Code that operates on the button
self.finish_game.text = "You lose"
self.add_widget(self.finish_game)
# The rest of the code that doesn't matter for now ...
class TestApp(App):
def build(self):
self.title = 'based graphics'
return Board()
TestApp().run()
But when I try this, I see through debugging mode that it goes inside the Board(), but it doesn't show anything on screen:
class StartBoard(Layout):
def _init_(self):
Layout._init_(self)
# Some code that works and not important
return Board()
class Board(GridLayout):
.... #As before
class TestApp(App):
def build(self):
self.title = 'based graphics'
return StartBoard()
TestApp().run()
I know it's not a full code, but maybe you could explain how does TestApp().run() works and why would Board() shows widgets when it run from TestApp.build() and not from StartBoard().