main.py 1.15 KB
Newer Older
Brady James Garvin's avatar
Brady James Garvin committed
1
from kivy.app import App
Brady James Garvin's avatar
Brady James Garvin committed
2
3
from kivy.modules import inspector # For inspection.
from kivy.core.window import Window # For inspection.
4
from kivy.properties import NumericProperty
Brady James Garvin's avatar
Brady James Garvin committed
5
6
7
8
9
10
11
12

__app_package__ = 'edu.unl.cse.soft161.order'
__app__ = 'Order Meal'
__version__ = '0.1'
__flags__ = ['--bootstrap=sdl2', '--requirements=python2,kivy', '--orientation=landscape']


class OrderApp(App):
13
14
15

    total = NumericProperty(0.00)

Brady James Garvin's avatar
Brady James Garvin committed
16
17
    def build(self):
        inspector.create_inspector(Window, self) # For inspection (press control-e to toggle).
Brady James Garvin's avatar
Brady James Garvin committed
18

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
    def update_total(self):
        self.total = 0.00
        if self.root.ids.spaghetti.active:
            self.total += 4.99

        if self.root.ids.penne_mostaccioli.active:
            self.total += 9000.01

        if self.root.ids.angel_hair.active:
            self.total += 0.01

        if self.root.ids.bow_tie.active:
            self.total += 2.99

        if self.root.ids.meat.active:
            self.total += 3.48

        if self.root.ids.marinara.active:
            self.total += 2.07

        if self.root.ids.alfredo.active:
            self.total += 6.66
Brady James Garvin's avatar
Brady James Garvin committed
41
42
43
44

if __name__ == '__main__':
    app = OrderApp()
    app.run()