Skip to content

ui.template #

fn clear #

fn clear()

fn new #

fn new() UIExample

struct UIExample #

struct UIExample {
pub mut:
	x_max int = 80
	y_max int = 60
}

fn (UIExample) ask_date #

fn (mut c UIExample) ask_date(args QuestionArgs) !string

fn (UIExample) ask_dropdown #

fn (mut c UIExample) ask_dropdown(args DropDownArgs) !string

return the dropdown as an int description string items []string warning string clear bool = true

fn (UIExample) ask_dropdown_int #

fn (mut c UIExample) ask_dropdown_int(args DropDownArgs) !int

will return the string as given as response description string items []string warning string clear bool = true

fn (UIExample) ask_dropdown_multiple #

fn (mut c UIExample) ask_dropdown_multiple(args DropDownArgs) ![]string

result can be multiple, also can select all description string items []string warning string clear bool = true

fn (UIExample) ask_question #

fn (mut c UIExample) ask_question(args QuestionArgs) !string

args:- description string

  • question string
  • warning: string (if it goes wrong, which message to use)
  • reset bool = true
  • regex: to check what result need to be part of
  • minlen: min nr of chars

fn (UIExample) ask_time #

fn (mut c UIExample) ask_time(args QuestionArgs) !string

fn (UIExample) ask_yesno #

fn (mut c UIExample) ask_yesno(args YesNoArgs) !bool

yes is true, no is false args:- description string

  • question string
  • warning string
  • clear bool = true