Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
flow3r firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
toerb
flow3r firmware
Commits
c348d30b
Commit
c348d30b
authored
1 year ago
by
iggy
Browse files
Options
Downloads
Patches
Plain Diff
forgot to include demo_menu.py
parent
8cbcf253
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python_payload/demo_menu.py
+48
-0
48 additions, 0 deletions
python_payload/demo_menu.py
with
48 additions
and
0 deletions
python_payload/demo_menu.py
0 → 100644
+
48
−
0
View file @
c348d30b
import
menu
import
event
import
hardware
import
demo_worms
,
demo_sparabo
def
start_worms
(
action
):
menu
.
menu_stack
.
append
(
menu
.
active_menu
)
menu
.
active_menu
=
None
demo_worms
.
run
()
def
start_sparabo
(
action
):
menu
.
menu_stack
.
append
(
menu
.
active_menu
)
menu
.
active_menu
=
None
demo_sparabo
.
run
()
menu_demo
=
menu
.
Menu
(
"
demo
"
)
item_worms
=
menu
.
MenuItem
(
"
worms
"
)
item_worms
.
action
=
start_worms
menu_demo
.
add
(
item_worms
)
item_abo
=
menu
.
MenuItem
(
"
abo
"
)
item_abo
.
action
=
start_sparabo
menu_demo
.
add
(
item_abo
)
testmenu
=
menu
.
Menu
(
"
test
"
)
item_add
=
menu
.
MenuItem
(
"
+
"
)
item_add
.
action
=
lambda
x
:
testmenu
.
add
(
menu
.
MenuItem
(
"
new {}
"
.
format
(
len
(
testmenu
.
items
))))
item_sub
=
menu
.
MenuItem
(
"
-
"
)
item_sub
.
action
=
lambda
x
:
testmenu
.
pop
()
if
len
(
testmenu
.
items
)
>
4
else
None
item_foo
=
menu
.
MenuItem
(
"
foo
"
)
testmenu
.
add
(
item_foo
)
testmenu
.
add
(
item_sub
)
testmenu
.
add
(
item_add
)
menu_main
=
menu
.
Menu
(
"
main
"
,
has_back
=
False
)
menu_main
.
add
(
menu
.
MenuItemSubmenu
(
testmenu
))
menu_main
.
add
(
menu
.
MenuItemSubmenu
(
menu_demo
))
menu_main
.
add
(
menu
.
MenuItem
(
"
nix
"
))
menu
.
set_active_menu
(
menu_main
)
menu
.
render
()
event
.
the_engine
.
eventloop
()
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