func NewInformationScreen(toptitle, title, msg string, extraTitle bool) *State { s := NewState() s.Draw = func(state *State) { term.DrawBackground() DrawTitle(state.toptitle + " - " + title) if extraTitle { asciiart, err := term.Figlet(title) if err != nil { DrawInformation(msg, "\n"+title+"\n") } else { DrawInformation(msg, asciiart) } } else { DrawInformation(msg, "") } } s.Handle = DefaultKeyHandler s.toptitle = toptitle return s }
// TODO: Find a good way to store input questions/answers in the state struct func GetInput(state *State) { term.DrawBackground() DrawTitle(state.toptitle + " - What will it be?") //answer := drawInputQuery("Hostname:") }
// TODO: Find a good way to store question-information in the state struct func AskQuestion(state *State) { term.DrawBackground() DrawTitle(state.toptitle + " - A serious question") alternatives := []string{"Red", "Orange", "Yellow", "Green", "Cyan", "Blue", "Violet", "Pink", "Magic", "Not listed"} DrawQuestion("What is your favorite color?", alternatives, state.listpos, state.buttonpos) }
func DefaultDrawFunction(state *State) { term.DrawBackground() DrawTitle("DEFAULT DRAW FUNCTION") }