Force main app to respect the configured window size
authorNeil <neil@dip.sun.ac.za>
Wed, 17 Apr 2013 10:18:31 +0000 (12:18 +0200)
committerNeil <neil@dip.sun.ac.za>
Wed, 17 Apr 2013 10:18:31 +0000 (12:18 +0200)
erdslangetjie/__main__.py

index cd17e87bc7279d555f9a03080ed957a602ce9381..95fdf1be5d3423a6e41fc20c63dd412af89e7d16 100644 (file)
@@ -5,7 +5,6 @@ import pygame
 kivy.require('1.6.0')
 
 from kivy.app import App
-from kivy.core.window import Window
 from kivy.uix.widget import Widget
 from kivy.logger import Logger, LoggerHistory
 from kivy.uix.relativelayout import RelativeLayout
@@ -48,6 +47,9 @@ class GameWindow(RelativeLayout):
         self.player.pos = self.level_obj.enter_pos
         if platform() != 'android':
             # Very hack'ish
+            # We need to delay this import until after the window creation by
+            # the app, else our size config doesn't work
+            from kivy.core.window import Window
             self.keyboard = Window.request_keyboard(self._closed, self)
             self.keyboard.bind(on_key_down=self._on_key_down)