Skip to content

Instantly share code, notes, and snippets.

@kashifpk
Created October 30, 2014 18:49
Show Gist options
  • Save kashifpk/3cfce1c88288c70c8637 to your computer and use it in GitHub Desktop.
Save kashifpk/3cfce1c88288c70c8637 to your computer and use it in GitHub Desktop.
Kivy Window.on_rotate issue
# -*- coding: utf-8 -*-
import kivy
kivy.require('1.8.0')
from kivy.app import App
from kivy.core.window import Window
from kivy.uix.textinput import TextInput
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import ListProperty, ObjectProperty
class MainWindow(BoxLayout):
"Main screen of the app"
def do_action(self, action):
"Called for good or bad button presses"
self.set_status(action)
print(Window.size)
self.orientation = 'vertical'
def set_status(self, msg):
self.lbl_status.text = msg
class GoodOrBadApp(App):
"The main app"
main_window = None
def rotate_screen(self, rotation):
print(rotation)
self.main_window.set_status(rotation)
def build(self):
print(Window.size)
Window.on_rotate(self.rotate_screen)
self.main_window = MainWindow()
return self.main_window
if __name__ == '__main__':
GoodOrBadApp().run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment