/kivy_stacklayout_2.py Secret
Created
September 20, 2022 08:09
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
import japanize_kivy | |
from kivy.app import App | |
from kivy.core.window import Window | |
from kivy.lang import Builder | |
from kivy.uix.stacklayout import StackLayout | |
Builder.load_file('kivy_stacklayout_2.kv') | |
Window.size = (200, 200) | |
class KivyStackLayout(StackLayout): | |
def on_button_pressed(self, instance): | |
print('ボタン %s がクリックされました。' % instance.text) | |
class ExampleApp(App): | |
def build(self): | |
self.title = 'StackLayout' | |
return KivyStackLayout() | |
if __name__ == '__main__': | |
ExampleApp().run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment