GuiAction_Call

Category: GUI
Since engine version: 7.0 OC

Description

Action for a GUI window event such as OnClick. The function that will be called will get the "value" parameter as the first parameter. Additional parameters are: player, gui_id, subwindow_id, target.

Syntax

array GuiAction_Call(proplist target, string function, any value);

Parameters

target:
The target object or definition that the callback will be called on.
function:
The name of the function that will be called.
value:
A custom parameter value that will be passed to your function. If you need more custom values, use an array or a proplist.

Remark

See the GUI documentation for further explanations.

Example

func Initialize()
{
	var menu =
	{
		BackgroundColor = RGB(255, 0, 0),
		OnClick = GuiAction_Call(this, "DoTheScream", nil)
	};
	var menuID = GuiOpen(menu);
}

func DoTheScream(data, int player, int gui_id, int subwindow_id, object target)
{
	Sound("Scream");
}
Defines a new GUI window that screams when you click it. This could be a scenario script.
See also: GUI Documentation, GuiAction_SetTag, GuiClose, GuiOpen, GuiUpdate, GuiUpdateTag
Zapper, 2014-10