Skip to content

Instantly share code, notes, and snippets.

@pamolloy
Last active December 20, 2015 20:49
Show Gist options
  • Save pamolloy/6193223 to your computer and use it in GitHub Desktop.
Save pamolloy/6193223 to your computer and use it in GitHub Desktop.
Executing the original code generated a window with only one widget (see http://i.imgur.com/JALe6q4.png). The problem was that I called the parent class within the super function.
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.button import Button
from kivy.uix.textinput import TextInput
class TestPlan(GridLayout):
def __init__(self, **kwargs):
super(TestPlan, self).__init__(**kwargs)
self.cols=2
self.add_widget(Button(text="Description"))
self.username=TextInput(multiline=False)
self.add_widget(self.username)
self.add_widget(Button(text="New"))
class Test(App):
def build(self):
return TestPlan()
Test().run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment