2

it should be like:

if entered this screen: call(function) I am also writing code using .kv file and .py at the same time so please give me a tip that will work in my occasion)

1 Answers1

3

Use either on_pre_enter or on_enter events in Python code or in kv file. Please refer the following snippets or another example using on_pre_enter

ScreenManager Events

Events:

on_pre_enter: ()

Event fired when the screen is about to be used: the entering animation is started.

Python Code

class ScreenTwo(Screen):

    def on_pre_enter(self):
        self.callback()

    def callback(self):
        print("callback")

kv file

<ScreenTwo>:
    on_pre_enter: root.callback()
ikolim
  • 15,721
  • 2
  • 19
  • 29