add OkBack
This commit is contained in:
parent
e3e660a69a
commit
eaf8036330
1 changed files with 15 additions and 1 deletions
|
@ -2,7 +2,7 @@ package menu
|
||||||
|
|
||||||
import "github.com/nexidian/gocliselect"
|
import "github.com/nexidian/gocliselect"
|
||||||
|
|
||||||
// Make a YesNo menu
|
// Make an OK menu
|
||||||
func Ok(msg string) string {
|
func Ok(msg string) string {
|
||||||
// Make the menu
|
// Make the menu
|
||||||
menu := gocliselect.NewMenu(msg)
|
menu := gocliselect.NewMenu(msg)
|
||||||
|
@ -14,3 +14,17 @@ func Ok(msg string) string {
|
||||||
// Return the value selected
|
// Return the value selected
|
||||||
return choice
|
return choice
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make an OK & Go Back menu
|
||||||
|
func OkBack(msg string) string {
|
||||||
|
// Make the menu
|
||||||
|
menu := gocliselect.NewMenu(msg)
|
||||||
|
menu.AddItem("OK", "next")
|
||||||
|
menu.AddItem("Go Back", "back")
|
||||||
|
|
||||||
|
// Display the menu
|
||||||
|
choice := menu.Display()
|
||||||
|
|
||||||
|
// Return the value selected
|
||||||
|
return choice
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue