Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from kivy.app import App
- from kivy.uix.button import Button
- #from kivy.uix.codeinput import CodeInput
- #from pygments.lexers import HtmlLexer
- from kivy.config import Config
- Config.set('graphics', 'resizable', '0');
- from kivy.uix.floatlayout import FloatLayout
- from kivy.uix.scatter import Scatter
- # noinspection PyUnreachableCode
- class MyApp(App):
- def build(self):
- s = Scatter()
- fl = FloatLayout(size = (300, 300))
- s.add_widget(fl)
- fl.add_widget(Button(
- text="Это Кнопка!",
- font_size = 16,
- on_press = self.btn_press,
- background_color = [.32, .85, .94, 1],
- background_normal = '',
- size_hint = (.5, .25),
- pos = (0, 10)));
- return s
- def btn_press(self, instance):
- print("Кнопка нажата!")
- instance.text = "Я нажата"
- if __name__ == "__main__":
- MyApp().run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement