From 78289f35ccf17a7dd1e51372a5ec65862c0040e8 Mon Sep 17 00:00:00 2001 From: emahmoud3 <emahmoud3@huskers.unl.edu> Date: Fri, 24 Jul 2020 07:04:04 -0500 Subject: [PATCH] connected the displayed price to the slider. --- main.py | 5 +++-- order.kv | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index d39a2a1..18892ed 100644 --- a/main.py +++ b/main.py @@ -4,12 +4,13 @@ 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). def amount_changed(self): - self.total= round(self.root.ids.food.value*100) - + self.total = round(self.root.ids.food.value * 100) if __name__ == '__main__': diff --git a/order.kv b/order.kv index e57aee9..7a6963d 100644 --- a/order.kv +++ b/order.kv @@ -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) + + + + + + + + + + -- GitLab