Skip to content

Instantly share code, notes, and snippets.

@wasimafser
Created July 3, 2019 07:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wasimafser/2d6b2c0ea6101829240a58e9dfc1a588 to your computer and use it in GitHub Desktop.
Save wasimafser/2d6b2c0ea6101829240a58e9dfc1a588 to your computer and use it in GitHub Desktop.
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