add OkBack

This commit is contained in:
HikariKnight 2023-10-29 12:08:37 +01:00
parent e3e660a69a
commit eaf8036330

View file

@ -2,7 +2,7 @@ package menu
import "github.com/nexidian/gocliselect"
// Make a YesNo menu
// Make an OK menu
func Ok(msg string) string {
// Make the menu
menu := gocliselect.NewMenu(msg)
@ -14,3 +14,17 @@ func Ok(msg string) string {
// Return the value selected
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
}