From a44557f23d383d7b8b264373e51beaa1a21129fb Mon Sep 17 00:00:00 2001 From: Blackman White <43486978+BlackmanWhite@users.noreply.github.com> Date: Sun, 14 Oct 2018 21:08:33 -0300 Subject: [PATCH] Added "create option" funtionality to example --- Example.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Example.py b/Example.py index 126a3fb..4a4fbd6 100644 --- a/Example.py +++ b/Example.py @@ -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: ") @@ -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)