Created
July 3, 2019 07:51
-
-
Save wasimafser/2d6b2c0ea6101829240a58e9dfc1a588 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.uix.button import Button | |
from kivy.uix.floatlayout import FloatLayout | |
from kivy.uix.modalview import ModalView | |
#from kivy.uix.textinput import TextInput | |
from kivy.properties import ObjectProperty, StringProperty | |
Builder.load_string(""" | |
<AppContainer> | |
Button: | |
text: '+' | |
size_hint: (0.1, 0.1) | |
pos_hint: {'right': 1} | |
on_press: root.add_url_modal.open_modal() | |
""") | |
class AddUrlModal(ModalView): | |
def open_modal(self): | |
self.open() | |
class AppContainer(FloatLayout): | |
add_url_modal = ObjectProperty(None) | |
def __init__(self, **kwargs): | |
self.add_url_modal = AddUrlModal() | |
def print_info(self): | |
print("Hello") | |
class PriceApp(App): | |
def build(self): | |
return AppContainer() | |
if __name__ == '__main__': | |
PriceApp().run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment