Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
meal-ordering-app
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Cale Wagner
meal-ordering-app
Commits
9c632910
Commit
9c632910
authored
8 years ago
by
Cale Wagner
Browse files
Options
Downloads
Patches
Plain Diff
Made kivy code to reflect a meal-ordering-app
parent
1f0ddda5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
main.py
+10
-1
10 additions, 1 deletion
main.py
order.kv
+49
-2
49 additions, 2 deletions
order.kv
with
59 additions
and
3 deletions
main.py
+
10
−
1
View file @
9c632910
from
kivy.app
import
App
from
kivy.modules
import
inspector
# For inspection.
from
kivy.core.window
import
Window
# For inspection.
from
kivy.modules
import
inspector
# For inspection.
__app_package__
=
'
edu.unl.cse.soft161.order
'
__app__
=
'
Order Meal
'
...
...
@@ -9,9 +9,18 @@ __flags__ = ['--bootstrap=sdl2', '--requirements=python2,kivy', '--orientation=l
class
OrderApp
(
App
):
def
build
(
self
):
inspector
.
create_inspector
(
Window
,
self
)
# For inspection (press control-e to toggle).
def
update_charge
(
self
):
if
self
.
root
.
ids
.
meat_slider
.
value
>
50
or
self
.
root
.
ids
.
rice_slider
.
value
>
50
or
\
self
.
root
.
ids
.
sauce_slider
>
50
or
self
.
root
.
ids
.
sour_cream_slider
>
50
or
\
50
>
self
.
root
.
ids
.
veggie_slider
:
self
.
extra_charge
=
True
else
:
self
.
extra_charge
=
False
if
__name__
==
'
__main__
'
:
app
=
OrderApp
()
...
...
This diff is collapsed.
Click to expand it.
order.kv
+
49
−
2
View file @
9c632910
BoxLayout:
orientation:
'vertic
al'
orientation:
'horizont
al'
Label:
text: '[Your meal-ordering GUI here]'
text: 'Create Your Own Burrito'
font_size: '36sp'
size_hint: (0, 0)
BoxLayout:
Slider:
id: meat_slider
range:(0, 100)
value: 50
on_value_pos: app.update_charge
Label:
text: 'Meat'
Slider:
id: rice_slider
range:(0, 100)
value: 50
on_value_pos: app.update_charge
Label:
text: 'Rice'
Slider:
id: sauce_slider
range:(0, 100)
value: 50
on_value_pos: app.update_charge
Label:
text: 'Sauce'
Slider:
id: sour_cream_slider
range:(0, 100)
value: 50
on_value_pos: app.update_charge
Label:
text: 'Sour Cream'
Slider:
id: veggie_slider
range:(0, 100)
value: 50
on_value_pos: app.update_charge
Label:
text:'Veggies'
BoxLayout:
orientation: 'horizontal'
Label:
text: 'Extra Charge'
font_size: '24sp'
color: (0.5, 0, 0, 0.6)
Label:
font_size: '24sp'
text: '$0.50' if app.update_charge else '$0.00'
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment