Created
March 6, 2013 23:11
-
-
Save tshirtman/5104122 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kivy.app import App | |
from kivy.lang import Builder | |
from kivy.core.window import Window | |
kv = ''' | |
FloatLayout: | |
TextInput: | |
id: text_input | |
pos_hint: {'top': 1} | |
size_hint: 1, None | |
height: 32 | |
ToggleButton: | |
text: 'dock' | |
on_state: app.switch(self) | |
size_hint: 1, None | |
top: text_input.y | |
''' | |
class MyApp(App): | |
def build(self): | |
return Builder.load_string(kv) | |
def switch(self, button): | |
if button.state == 'down': | |
Window.allow_vkeyboard = True | |
Window.single_vkeyboard = True | |
Window.docked_vkeyboard = True | |
print "activated dock" | |
else: | |
Window.allow_vkeyboard = False | |
Window.single_vkeyboard = True | |
Window.docked_vkeyboard = False | |
print "unactivated dock" | |
MyApp().run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment