Skip to content

Instantly share code, notes, and snippets.

@OlyDLG
Created April 14, 2015 20:13
Show Gist options
  • Save OlyDLG/a84bcb3a93f4034cec60 to your computer and use it in GitHub Desktop.
Save OlyDLG/a84bcb3a93f4034cec60 to your computer and use it in GitHub Desktop.
Demo of Q re: how to access something after runTouchApp() has been called
from kivy.app import App
from kivy.uix.screenmanager import Screen, ScreenManager
from kivy.garden.graph import Graph
class appInternalsScreen(Screen):
def __init__(self, **kwargs):
super(appInternalsScreen, self).__init__(**kwargs)
G = Graph(x_grid_label=True, y_grid_label=True,
x_ticks_major = 10, y_ticks_major = 10)
self.add_widget(G)
class appInternalsApp(App):
def build(self):
self.sm = ScreenManager()
self.sm.add_widget(appInternalsScreen(name='home'))
return self.sm
if __name__ == '__main__':
IA = appInternalsApp()
IA.run()
@Enteleform
Copy link

Nice solution, just started messing with Kivy this week and couldn't find info anywhere else about this. 😄

I was interested in finding out why it worked and ended up writing a StackOverflow answer with my findings. Check it out @ http://stackoverflow.com/questions/24664181/how-do-i-run-a-function-once-the-form-is-loaded-kivy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment