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
5 * Copyright (C) Digiteo - 2009 - Jean-Baptiste Silvy
7 * This file must be used under the terms of the CeCILL.
8 * This source file is licensed as described in the file COPYING, which
9 * you should have received as part of this distribution. The terms
10 * are also available at
11 * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
14 <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="get">
16 <refname>get</refname>
17 <refpurpose>Retrieve a property value from a graphics
18 entity or an User Interface object.
22 <title>Calling Sequence</title>
25 val=get(handlePath,prop)
30 <title>Arguments</title>
35 <para>handle, the handle of the entity to retrieve a property.
36 <literal>h</literal> can be a vector of handles, in which case get returns
37 the property value for all objects contained in h. <literal>h</literal> can also be <emphasis>0</emphasis> to get the root object properties.
42 <term>handlePath</term>
45 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).
48 Deeper hierarchy levels can also be used such as <literal>"figuretag/entity1tag/entity2tag/entitntag/entitytag"</literal>. Wildcards can also be used for multi-paths search. The first entity matching the path will be used.
55 <para>character string name of the property.</para>
61 <para>value of the property.</para>
67 <title>Description</title>
68 <para>This routine can be used to retrieve the value of a specified property from a
69 graphics entity or a GUI object. In this case it is equivalent to use the dot operator on a handle.
70 For exemple, <literal>get(h,"background")</literal> is equivalent to <literal>h.background</literal>.
72 <para>Property names are character strings. To get the list of all existing properties
73 see <link linkend="graphics_entities">graphics_entities</link> or <link linkend="uicontrol">uicontrol</link>
74 for User Interface objects.
77 <literal>get</literal> function can be also called with only a property as argument. In this case,
78 the property must be one of the following (called with other properties names, <literal>get</literal> will return <literal>[]</literal>):
82 <term>current_entity or hdl</term>
84 <para>returns a handle on the lastly created (and still
86 <literal>get('current_entity')</literal> and <literal>get('hdl')</literal> are equivalent to <link linkend="gce">gce</link>.
91 <term>current_figure</term>
93 <para>returns a handle on the current graphic figure.
94 <literal>get('current_figure')</literal> is equivalent to <link linkend="gcf">gcf</link>.
99 <term>current_axes</term>
101 <para>returns a handle on the current axes entity.
102 <literal>get('current_axes')</literal> is equivalent to <link linkend="gca">gca</link>.
107 <term>default_figure</term>
109 <para>returns a handle on the default figure entity.
110 <literal>get('default_figure')</literal> is equivalent to <link linkend="gdf">gdf</link>.
115 <term>default_axes</term>
117 <para>returns a handle on the default axes entity.
118 <literal>get('default_axes')</literal> is equivalent to <link linkend="gda">gda</link>.
123 <term>figures_id</term>
125 <para>returns a row vector containing ids of all opened graphic figures.
126 <literal>get('figures_id')</literal> is equivalent to <link linkend="winsid">winsid</link>.
133 <title>Examples</title>
135 <programlisting role="example"><![CDATA[
136 // for graphics entities
139 // simple graphics objects
146 xfarc(.25,.55,.1,.15,0,64*360);
147 xfarc(.55,.55,.1,.15,0,64*360);
148 xstring(0.2,.9,"Example <<A CAR>>");
150 h=get("current_entity") //get the newly object created
153 f=get("current_figure") //get the current figure
155 f.figure_size=[700 500];
158 f.children(2).children
159 f.children(2).children.children.thickness=4;
161 a=get("current_axes") //get the current axes
163 a.children.foreground //get the foreground color of a set of graphics objects
164 a.children.foreground=9;
166 // for User Interface objects
167 h=uicontrol('string', 'Button'); // Opens a window with a button.
168 p=get(h,'position'); // get the geometric aspect of the button
169 disp('Button width: ' + string(p(3))); // print the width of the button
170 close(); // close figure
174 <programlisting role="example"><![CDATA[
176 f = figure("dockable", "off", "menubar", "none", "toolbar", "none", "infobar_visible", "off", "tag", "mainfig");
177 frameHandle = uicontrol("parent", f, "style", "frame", "position", [200 200 190 100], "tag", "myframe");
178 btnHandle = uicontrol("parent", frameHandle, "position", [20 20 150 30], "string", "button", "tag", "example");
180 set("mainfig/myframe/example", "string", "complete path");
181 get("mainfig/myframe/example", "string")
182 set("mainfig/*/example", "string", "wildcard path");
183 get("mainfig/*/example", "string")
184 set("myframe/example", "string", "partial path");
185 get("myframe/example", "string")
189 <refsection role="see also">
190 <title>See Also</title>
191 <simplelist type="inline">
193 <link linkend="uicontrol">uicontrol</link>
196 <link linkend="root_properties">root_properties</link>
199 <link linkend="graphics_entities">graphics_entities</link>
202 <link linkend="set">set</link>