Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Brandon Joseph Huettner
meal-ordering-app
Commits
93137251
Commit
93137251
authored
Jan 27, 2017
by
Brandon Huettner
Browse files
My first commit of the app!
parent
1f0ddda5
Changes
2
Hide whitespace changes
Inline
Side-by-side
main.py
View file @
93137251
...
...
@@ -9,9 +9,22 @@ __flags__ = ['--bootstrap=sdl2', '--requirements=python2,kivy', '--orientation=l
class
OrderApp
(
App
):
charge
=
9.99
def
build
(
self
):
inspector
.
create_inspector
(
Window
,
self
)
# For inspection (press control-e to toggle).
def
update_cost
(
self
):
if
self
.
root
.
ids
.
size_slider
.
value
<
50
:
self
.
charge
=
"10.99"
self
.
root
.
ids
.
price
.
text
=
self
.
charge
elif
self
.
root
.
ids
.
size_slider
.
value
==
50
:
self
.
charge
=
"11.99"
self
.
root
.
ids
.
price
.
text
=
self
.
charge
elif
self
.
root
.
ids
.
size_slider
.
value
>
50
:
self
.
charge
=
"12.99"
self
.
root
.
ids
.
price
.
text
=
self
.
charge
if
__name__
==
'__main__'
:
app
=
OrderApp
()
...
...
order.kv
View file @
93137251
BoxLayout:
orientation: 'vertical'
Label:
text: '[Your meal-ordering GUI here]'
text: 'HuHot'
font_size: '42sp'
color: [255,0,0,1]
BoxLayout:
orientation: 'vertical'
Label:
text: 'Build your meal:'
BoxLayout:
orientation: 'vertical'
Label:
text: 'Meats:'
BoxLayout:
orientation: 'vertical'
BoxLayout:
orientation: 'horizontal'
CheckBox:
BoxLayout:
orientation: 'horizontal'
Label:
text: 'Beef'
halign: 'right'
BoxLayout:
orientation: 'vertical'
Label:
text: 'Vegetables:'
BoxLayout:
orientation: 'vertical'
Label:
text: 'Sauces:'
BoxLayout:
orientation: 'vertical'
Label:
text: 'Meal Size'
Slider:
orientation: 'horizontal'
padding: '100sp'
step: 50
id: size_slider
on_value_pos: app.update_cost()
Label:
text: 'Little Warrier'
halign: 'left'
Label:
text: 'bigger'
halign: 'center'
Label:
text: 'biggest'
halign: 'right'
BoxLayout:
orientation: 'vertical'
Label:
id: price
text: str(app.charge)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment