1 <?xml version="1.0" encoding="UTF-8"?>
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) INRIA - Djalel Abdemouche
6 * Copyright (C) 2012 - 2016 - Scilab Enterprises
8 * This file is hereby licensed under the terms of the GNU GPL v2.0,
9 * pursuant to article 5.3.4 of the CeCILL v.2.1.
10 * This file was originally licensed under the terms of the CeCILL v2.1,
11 * and continues to be available under such terms.
12 * For more information, see the COPYING file which you should have received
13 * along with this program.
16 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="set">
18 <refname>set</refname>
19 <refpurpose>set a property value of a graphic entity
20 object or of a User Interface object.
29 set(handlePath,prop,val[,prop2, val2, ..., propn, valn])
34 <title>Arguments</title>
39 <para>graphic handle of the entity which to set the named
40 property. <literal>h</literal> can be a vector of handles, in which case
41 set modifies the property for all entities contained in h.
46 <term>handlePath</term>
49 A character string containing a path pointing to the graphic entity. This path is made of the graphic entity <literal>"Tag"</literal> property and the <literal>"Tag"</literal> property of its parents in the graphics hierarchy under the format <literal>"figuretag/entitytag"</literal> (when the entity is the child of a figure).
52 Deeper hierarchy levels can also be used such as <literal>"figuretag/entity1tag/entity2tag/entityntag/entitytag"</literal>. Wildcards can also be used for multi-paths search. The first entity matching the path will be used.
59 <para>character string, name of the property to set.</para>
65 <para>value to give to the property.</para>
71 <title>Description</title>
72 <para>This routine can be used to modify the value of a specified property from a
73 graphics entity or a GUI object. In this case it is equivalent to use the dot operator on a handle.
74 For example, <literal>set(h,"background",5)</literal> is equivalent to <literal>h.background = 5</literal>.
76 <para>Property names are character strings. The type of the set values depends on the handle type and property.
78 <para>To get the list of all existing properties
79 see <link linkend="graphics_entities">graphics_entities</link> or <link linkend="uicontrol">uicontrol</link>
80 for User Interface objects.
83 <literal>set</literal> function can be also called with only a property and a value as argument. In this case,
84 the property must be one of the following:
88 <term>current_entity or hdl</term>
91 <literal>set('current_entity',h)</literal> or <literal>set('hdl',h)</literal> sets a new entity as current.
92 In this case, the value must be a graphic handle.
97 <term>current_figure</term>
100 <literal>set('current_figure',fig)</literal> sets a new graphic figure as current.
101 It is equivalent to <link linkend="scf">scf</link>. In this case, the value must be a Figure handle.
106 <term>current_axes</term>
109 <literal>set('current_axes',axes)</literal> sets a new axes entity as current.
110 It is equivalent to <link linkend="sca">sca</link>. In this case, the value must be an Axes handle.
116 <literal>set</literal> can also be called with a graphic handle and property as arguments.
117 The handle must be either a handle on the default figure or the default axes entities.
118 The property must be <literal>"default_values"</literal>. In this case, the default entity
119 is reset to the value it had at Scilab startup. <literal>set("default_values",h)</literal>
120 is equivalent to <link linkend="sda">sda</link> or <link linkend="sdf">sdf</link>.
124 <title>Examples</title>
126 <programlisting role="example"><![CDATA[
128 set("auto_clear","off") ;
129 // Example of a Plot 2D
131 plot2d(x-.3,[sin(x-1) cos(2*x)],[1 2] );
132 a=get("current_axes");
133 p1=a.children.children(1);
134 p2=a.children.children(2);
135 // set the named properties to the specified values on the objects
136 set(p2,"foreground",13);
137 set(p2,"polyline_style",2);
138 set(a,'tight_limits',"on");
140 set(a,"sub_tics",[ 7 0 ]);
141 set(a,"y_location","middle")
142 set(p2,'thickness',2);
143 set(p1,'mark_mode',"on");
144 set(p1,'mark_style',3);
146 p3= a.children(1).children;
147 set([a p1 p2 p3],"foreground",5)
151 <programlisting role="example"><![CDATA[
153 f = figure("dockable", "off", "menubar", "none", "toolbar", "none", "infobar_visible", "off", "tag", "mainfig");
154 frameHandle = uicontrol("parent", f, "style", "frame", "position", [200 200 190 100], "tag", "myframe");
155 btnHandle = uicontrol("parent", frameHandle, "position", [20 20 150 30], "string", "button", "tag", "example");
157 set("mainfig/myframe/example", "string", "complete path");
158 get("mainfig/myframe/example", "string")
159 set("mainfig/*/example", "string", "wildcard path");
160 get("mainfig/*/example", "string")
161 set("myframe/example", "string", "partial path");
162 get("myframe/example", "string")
166 <refsection role="see also">
167 <title>See also</title>
168 <simplelist type="inline">
170 <link linkend="get">get</link>
173 <link linkend="delete">delete</link>
176 <link linkend="copy">copy</link>
179 <link linkend="move">move</link>
182 <link linkend="graphics_entities">graphics_entities</link>
185 <link linkend="uicontrol">uicontrol</link>
190 <title>History</title>
193 <revnumber>5.5.0</revnumber>
197 First input argument can now be a path pointing to the graphic entity.
200 Multiple property setting is now available at once.