I assume kivy has its own python and support libs, but in case it matters, my default python is python.org's 64-bit python (for MacOS 10.6 and later). My python it has its own pygame and SDL (in /Library/Frameworks) so I tried deinstalling those, but it made no difference.Also, I notice that when I run the app I can get an about box, but New and Open... in the file menu are grayed out.Any suggestions?
#!/usr/bin/pythonimport pygameimport kivy
from kivy.app import Appfrom kivy.uix.floatlayout import FloatLayoutfrom kivy.properties import ObjectProperty, NumericProperty, StringPropertyfrom kivy.uix.button import Buttonfrom kivy.core.window import Windowfrom kivy.config import Config
Config.set('graphics', 'width', '524')Config.set('graphics', 'height', '668')Config.set('graphics', 'resizable', (0, 1))
class Example(FloatLayout):
pot = NumericProperty() def __init__(self, **kwargs): super(Example, self).__init__(**kwargs)
def call(self): self.pot += 100 def fold(self): print "Fold" class ExampleApp(App): def build(self): return Example(info=0) if __name__ == '__main__': ExampleApp().run()#:kivy 1.0
<Example>: canvas: Color: rgb: 1, 1, 0 Rectangle: pos: self.pos size: self.size Button: text: 'Call' on_press: root.call() size: (100,50) size_hint: (None, None) pos: (0,0) Button: text: 'Fold' on_press: root.fold() size: (100,50) size_hint: (None, None) pos: (105,0) Label: text: 'Pot ' + str(root.pot) size: (100,10) size_hint: (None, None) pos: (100, 200) color: (0, 0, 0, .9)[WARNING] [WinPygame ] SDL wrapper failed to import!