File: GuiAction_Call.xml

package info (click to toggle)
openclonk 8.1-4
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 169,520 kB
  • sloc: cpp: 180,479; ansic: 108,988; xml: 31,371; python: 1,223; php: 767; makefile: 145; sh: 101; javascript: 34
file content (56 lines) | stat: -rw-r--r-- 1,981 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
	<func>
		<title>GuiAction_Call</title>
		<category>GUI</category>
		<version>7.0 OC</version>
		<syntax>
			<rtype>array</rtype>
			<params>
				<param>
					<type>proplist</type>
					<name>target</name>
					<desc>The target object or definition that the callback will be called on.</desc>
				</param>
				<param>
					<type>string</type>
					<name>function</name>
					<desc>The name of the function that will be called.</desc>
				</param>
				<param>
					<type>any</type>
					<name>value</name>
					<desc>A custom parameter value that will be passed to your function. If you need more custom values, use an array or a proplist.</desc>
				</param>
			</params>
		</syntax>
		<desc>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. </desc>
		<remark>See the <emlink href="script/GUI.html">GUI documentation</emlink> for further explanations.</remark>
		<examples>
			<example>
<code>
func Initialize()
{
	var menu =
	{
		BackgroundColor = <funclink>RGB</funclink>(255, 0, 0),
		OnClick = <funclink>GuiAction_Call</funclink>(this, "DoTheScream", nil)
	};
	var menuID = <funclink>GuiOpen</funclink>(menu);
}

func DoTheScream(data, int player, int gui_id, int subwindow_id, object target)
{
	Sound("Scream");
}
</code>
				<text>Defines a new GUI window that screams when you click it. This could be a scenario script.</text>
			</example>
		</examples>
		<related><emlink href="script/GUI.html">GUI Documentation</emlink><funclink>GuiAction_SetTag</funclink><funclink>GuiClose</funclink><funclink>GuiOpen</funclink><funclink>GuiUpdate</funclink><funclink>GuiUpdateTag</funclink></related>
	</func>
	<author>Zapper</author><date>2014-10</date>
</funcs>