Skip to content

Commit

Permalink
Added "create option" funtionality to example
Browse files Browse the repository at this point in the history
  • Loading branch information
peroh215 authored Oct 15, 2018
1 parent 63623f0 commit a44557f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Example.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ def changetitle():
usr = input("Enter new title: ")
m.change_title(' %s '% (usr))
m.print_menu()

def add_opt():
option = input("Enter new option: ")
func = input("Enter function that option will execute: ")
ETM.Option(option, func)

def remove_opt():
usr = input("Enter option name: ")
Expand All @@ -34,6 +39,7 @@ def exitapp():
m = ETM.Menu(' MyApp ','-')
ETM.Option('Print info', print_info)
ETM.Option('Change title', changetitle)
ETM.Option('Create an option', add_opt)
ETM.Option('Delete an option', remove_opt)
ETM.Option('Clear options', clear_opt)
ETM.Option('Exit', exitapp)
Expand Down

0 comments on commit a44557f

Please sign in to comment.