tvSetPicture: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(syntax & example)
m (Fix)
 
(48 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma3 |= Game name
|game1= arma3
|version1= 0.74


|0.74|= Game version
|gr1= GUI Control - Tree View


|arg= local |= Arguments in MP
|descr= Sets picture to item selected by path. IDC means id of parent Tree View. Name is picture name. The picture is searched in the mission directory.
{{Feature|informative|
Adding pictures to lists is very slow. In order to prevent the filling of the list to be slowed down, add the pictures in a '''scheduled''' environment - See {{Link|#Example 3}}.
One drawback of this method is that sorting the entries is not easily possible.
}}


|eff= local |= Effects in MP
|s1= [[tvSetPicture]] [idc, path, name]
____________________________________________________________________________________________


| Sets picture to item selected by path. IDC means id of parent Tree View.
|p1= idc: [[Number]]
<br>
Name is picture name. The picture is searched in the mission directory. |= Description
____________________________________________________________________________________________


| [[tvSetPicture]] [idc, [path], name] |= Syntax
|p2= path: [[Array]] of [[Number]]s


|p1= [idc, [path], name]: [[Array]] |= PARAMETER1
|p3= name: [[String]]


|p2= idc: [[Number]] |= PARAMETER2
|r1= [[Nothing]]


|p3= [path]: [[Array]] - Array containing numbers. |= PARAMETER3
|s2= control [[tvSetPicture]] [path, name]


|p4= name: [[String]] |= PARAMETER4
|p21= control: [[Control]]


| [[Nothing]] |= RETURNVALUE
|p22= path: [[Array]] of [[Number]]s
____________________________________________________________________________________________
| s2= _ctrl [[tvSetPicture]] [ [path], name] |= Syntax


| p21= _ctrl: [[Control]] |= PARAMETER1
|p23= name: [[String]]


| p22= [ [path], name]: [[Array]] |= PARAMETER2
|r2= [[Nothing]]


| r2= [[Nothing]] |= RETURNVALUE
|x1= <sqf>tvSetPicture [101, [0], "picture"];</sqf>
____________________________________________________________________________________________


|x1= <code>[[tvSetPicture]] [101, [0], "picture"];</code> |= Example 1
|x2= <sqf>_ctrl tvSetPicture [[0,0,0], getText (configFile >> "CfgWeapons" >> "optic_NVS" >> "picture")];</sqf>


|x2= <code>_ctrl [[tvSetPicture]] [ [0,0,0], [[getText]] ([[configFile]] >> "CfgWeapons" >> "optic_NVS" >> "picture")];</code> |= Example 2
|x3= Adding images in a scheduled environment:
____________________________________________________________________________________________
<sqf>
private _path = _ctrlTV tvAdd [[], "Some Entry"];
[_ctrlTV, _path] spawn {
(_this select 0) tvSetPictureRight [[_this select 1], "someImage.paa"];
};
</sqf>


| [[tvAdd]], [[tvClear]], [[tvCollapse]], [[tvCount]], [[tvCurSel]], [[tvData]], [[tvDelete]], [[tvExpand]], [[tvPicture]], [[tvSetCurSel]], [[tvSetData]], [[tvSetValue]], [[tvSort]], [[tvSortByValue]], [[tvText]], [[tvValue]] |= See Also
|seealso= [[tvPicture]] [[tvSetPictureColor]] [[tvSetPictureRight]] [[tvSetPictureRightColor]]
 
|  |= MPBEHAVIOUR
____________________________________________________________________________________________
}}
}}
<h3 style='display:none'>Notes</h3>
<dl class='command_description'>
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style='display:none'>Bottom Section</h3>
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Command_Group:_GUI_Control|{{uc:{{PAGENAME}}}}]]

Latest revision as of 22:26, 29 March 2024

Hover & click on the images for description

Description

Description:
Sets picture to item selected by path. IDC means id of parent Tree View. Name is picture name. The picture is searched in the mission directory.
Adding pictures to lists is very slow. In order to prevent the filling of the list to be slowed down, add the pictures in a scheduled environment - See Example 3. One drawback of this method is that sorting the entries is not easily possible.
Groups:
GUI Control - Tree View

Syntax

Syntax:
tvSetPicture [idc, path, name]
Parameters:
idc: Number
path: Array of Numbers
name: String
Return Value:
Nothing

Alternative Syntax

Syntax:
control tvSetPicture [path, name]
Parameters:
control: Control
path: Array of Numbers
name: String
Return Value:
Nothing

Examples

Example 1:
tvSetPicture [101, [0], "picture"];
Example 2:
_ctrl tvSetPicture [[0,0,0], getText (configFile >> "CfgWeapons" >> "optic_NVS" >> "picture")];
Example 3:
Adding images in a scheduled environment:
private _path = _ctrlTV tvAdd [[], "Some Entry"]; [_ctrlTV, _path] spawn { (_this select 0) tvSetPictureRight [[_this select 1], "someImage.paa"]; };

Additional Information

See also:
tvPicture tvSetPictureColor tvSetPictureRight tvSetPictureRightColor

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note