Skip to content
Snippets Groups Projects
Commit 78289f35 authored by emahmoud3's avatar emahmoud3
Browse files

connected the displayed price to the slider.

parent d68496b0
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,8 @@ from kivy.core.window import Window # For inspection.
from kivy.properties import NumericProperty
class OrderApp(App):
instance = NumericProperty(0)
amount = NumericProperty(0)
total = NumericProperty(0) # in cents
def build(self):
inspector.create_inspector(Window, self) # For inspection (press control-e to toggle).
......@@ -11,7 +13,6 @@ class OrderApp(App):
self.total = round(self.root.ids.food.value * 100)
if __name__ == '__main__':
app = OrderApp()
app.run()
......@@ -26,3 +26,39 @@ BoxLayout:
Label:
text: f' your total is ${app.total /100:.2f}.'
font_size: sp(24)
BoxLayout:
Label:
text: 'Switch to enter your order'
Switch:
id: switch
Label:
text: 'your order is done' if switch.active else 'Wait your order is still working'
ToggleButton:
text: 'Male'
group: 'Gender'
ToggleButton:
text: 'Female'
group: 'Gender'
status: 'Down'
Image:
source: 'Em.jpg'
size: self.texture_size
size_hint: (2,2)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment