Let's pretend I am building a tic-tac-toe game (becouse it's pretty similar as a structure) I want the result to be shown in a popup, with a new game button, and I want this popup to let me access settings (with another button) and change them, always staying within the popup, then leave and finally close it and start a new game.
I wish i could keep things ordered and therefore have a separate popup class where i can build my custom popup.
I have the newgame method and reset method as method of my game-grid class, as obvious. Methods for changing settings are, on the other hand, on a custom settings class
While designing the popup class how can I bind it's buttons (e.g new game) to methods that are contained on a completly different class? I've looked on some kv examples and they usually use root.blabla.method to acces a method that is in a different position of the same tree (in the .kv file) but here the methods I am trying to reach are out of the tree!
I'll try to put some example code to make it more clear
class Settings():
def changeSettings(self):
....
class GmeGrid(GridLayout):
def newGame(self):
....
def reset(self):
...
class customPopup(Popup):
pass
Then, on a .kv file I wish I could bind some popup's buttons to the newGame and change settings methods
The problem here is that I should bind buttons on the popop class to the mothods of completly different class and I don't know how to to that (on the .kv file especially)