Skip to content

Instantly share code, notes, and snippets.

@RobertPython
Last active March 15, 2022 09:38
Show Gist options
  • Save RobertPython/9d170a7411e3240d6494ff182e851e1d to your computer and use it in GitHub Desktop.
Save RobertPython/9d170a7411e3240d6494ff182e851e1d to your computer and use it in GitHub Desktop.
appapp
from Lib.idlelib.idle_test.test_colorizer import source
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.uix.image import Image
from kivy.uix.button import Button
from kivy.uix.text input import TextInput
def build(self):
self.window = GridLayout()
self.window.cols = 1
self.window.size_hint = (0.6, 0.7)
self.window.pos_hint = {"center_x": 0.5, "center_y": 0.5 }
self.window.add_widget(Image(source("logo.jpg")))
self.ageRequest = Label(
text = "Enter your date of birth...",
font_size = 50,
color = "#ffffff",
bold = True
)
self.window.add_widget(self.ageRequest)
self.date = TextInput(
multiline=False,
padding_y = (30, 30),
size_hint = (1, 0.7),
font_size = 30
)
self.window.add_widget(self.date)
self.button = Button(
text = "Calculate Age",
size_hint = (0.5, 0.5),
bold = True,
font_size = 30
)
self.button.bind(on_press = self.getAge)
self.window.add_widget(self.button)
return self.window
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment