GuiClose

Category: GUI
Since engine version: 7.0 OC

Description

Closes an existing GUI window, that has previously been opened with GuiOpen(). It is possible to close only one certain sub-window by passing child_id and target. Returns true if a window was closed.

Syntax

bool GuiClose(int gui_id, int child_id, object target);

Parameters

gui_id:
The ID of the gui window that was returned by GuiOpen().
child_id:
Optional. If given, the sub-window of the gui_id window with the matching child_id will be closed. Should be used together with the parameter target.
target:
Optional. Should be used together with child_id. The target of the sub-window that will be closed.

Remark

See the GUI documentation for further explanations.

Example

var menu =
{
	left_part = 
	{
		Right = "50%",
		ID = 1,
		BackgroundColor = RGB(255, 0, 0)
	},
	right_part = 
	{
		Left = "50%",
		ID = 2,
		BackgroundColor = RGB(0, 255, 0)
	}
};
var menuID = GuiOpen(menu);
GuiClose(menuID, 2, nil);
Opens a menu window consisting of two parts and then closes the right half.
See also: GUI Documentation, GuiAction_Call, GuiAction_SetTag, GuiOpen, GuiUpdate, GuiUpdateTag
Zapper, 2014-10