aboutsummaryrefslogtreecommitdiff
path: root/builtin/fstk/dialog.lua
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/fstk/dialog.lua')
-rw-r--r--builtin/fstk/dialog.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/builtin/fstk/dialog.lua b/builtin/fstk/dialog.lua
index df887f413..ea57df1d2 100644
--- a/builtin/fstk/dialog.lua
+++ b/builtin/fstk/dialog.lua
@@ -67,3 +67,22 @@ function dialog_create(name,get_formspec,buttonhandler,eventhandler)
ui.add(self)
return self
end
+
+function messagebox(name, message)
+ return dialog_create(name,
+ function()
+ return ([[
+ formspec_version[3]
+ size[8,3]
+ textarea[0.375,0.375;7.25,1.2;;;%s]
+ button[3,1.825;2,0.8;ok;%s]
+ ]]):format(message, fgettext("OK"))
+ end,
+ function(this, fields)
+ if fields.ok then
+ this:delete()
+ return true
+ end
+ end,
+ nil)
+end