local Dia, Window = require("dialog"), require("window") local win function _init() win = Window:new() win:attach("choice", Dia.Choice:new("Question!", "What kind of ice cream do you like?",{ {label = "Vanilla", action = chosen("vanilla")}, {label = "Chocolate", action = chosen("chocolate")}, {label = "Strawberry", action = chosen("strawberry")}, })) win:attach("alert", Dia.Alert:new("For your information!", "You're pretty great!")) .ondone = function(alert) print("okay? okay..") end win:attach("confirm", Dia.Confirm:new("Uhmm..", "Are you sure about that?")) .ondone = function(alert, yes) if yes then print("Okay then..") else print("Oh good..") end end win:attach("prompt", Dia.Prompt:new("Hey there!", "What's your name?")) .ondone = function(alert, value) if value then print("Hello "..value.."!") else print("It's okay to be shy.") end end view.active(win.container) end function _step(t) win:step(t) end function chosen(choice) return function() print("Excellent choice!") print("I like "..choice.." too!") end end