QuestionDialog: Difference between revisions

From Vendetta Lua
Jump to navigationJump to search
New page: A fullscreen iup dialog with two buttons that can be used to ask for confirmation and stuff like that. Display with :show() or ShowDialog(). == Functions == === SetMessage === '''Definit...
 
No edit summary
Line 1: Line 1:
[[Image:QuestionDialog.jpg]]
A fullscreen iup dialog with two buttons that can be used to ask for confirmation and stuff like that. Display with :show() or ShowDialog().
A fullscreen iup dialog with two buttons that can be used to ask for confirmation and stuff like that. Display with :show() or ShowDialog().



Revision as of 23:07, 30 April 2008

File:QuestionDialog.jpg

A fullscreen iup dialog with two buttons that can be used to ask for confirmation and stuff like that. Display with :show() or ShowDialog().

Functions

SetMessage

Definition:
SetMessage(ihandle qdialog, string message, string ltitle, function lcb, string rtitle, function rcb) -> nil

Description:
Sets message plus title and callbacks for the buttons.

Arguments:
qdialog the question dialog (can be omitted with the colon syntax)
message message to display in the dialog
ltitle left button title
lcb left button callback
rtitle right button title
rcb right button callback

Returns:

Example:
<source lang="lua"> local function yes_cb() print("you said yes") HideDialog(QuestionDialog) end

local function no_cb() print("you said no") HideDialog(QuestionDialog) end

QuestionDialog:SetMessage("Answer me!", "Yes", yes_cb, "No", no_cb) ShowDialog(QuestionDialog) </source>