I have the following code in a kivy app. I am pasting only the code related to Button as this is what is not working. The rest of the code is about displaying the list data in a datagrid, which works fine.
class PnLScreen(Screen):
data = ListProperty(defaultvalue=[])
processing = BooleanProperty(defaultvalue=False)
def __init__(self, **kwargs):
super().__init__(**kwargs)
tryout.get_nse_prices()
tryout.get_bse_prices()
tryout.get_isin_to_symbol_map()
self.box = BoxLayout(orientation='vertical')
button = Button(size_hint_y=None)
button.bind(on_press=self.go_home)
self.box.add_widget(button)
def go_home(self,instance):
print("called from %s" % instance.text)
# will figure out how to go home!
Now the button is displayed when the screen becomes current. But on clicking on the button, the bound function go_home is never called. I use buttons in other screens where it works. So I am not sure why this will not! Actually I am quite exasperated not being able to get this simple thing working.
Thanks in advance