|
|
|
|
SynopsisRetrieves the attribute value(s) of the label. Syntaxget_label(); get_label(id [,attribute]); Description
The get_label command returns a structure containing all the attribute values of the label. To retrieve the value of a specific attribute, provide the attribute name and the id or ChipsId of the object. Some values are set to "None" in the returned structure. These entries generally correspond to attributes which may only be modified at creation time, such as the object id. The attributes associated with labels are:
Note that the label text is not included in the attributes. In order to get that value, use the get_label_text command. To see if a label is hidden or visible, use the get_label_visible command. Advanced FunctionsThe module of advanced ChIPS functions contains other commands for retrieving attribute values (refer to "ahelp chips" for information on loading the module): get_label_angle get_label_color get_label_depth get_label_font get_label_fontstyle get_label_halign get_label_size get_label_valign Example 1
chips> add_label(.4, .8, "C_6H_{12}O_6");
chips> print(get_label());
chips> print(get_label("lbl1","font"));A label is created and becomes current. Calling get_label with no argument returns all the attributes of the object. get_label is called a second time to return just the "font" attribute. Example 2
chips> add_label(.4, .8, "C_6H_{12}O_6");
chips> add_label(.4, .9, "x_1 * x_1 = x_1^2", "color=green");
chips> print(get_label("lbl1"));Two labels are created. get_label is called with the id of the first label, returning all attributes. Example 3chips> id=ChipsId(); chips> id.label="lbl1"; chips> print(get_label(id)); A ChipsId structure is created and the id.label field is set to "lbl1". get_label is called with the ChipsId. Example 4chips> lblatt=get_label; chips> print(lblatt); Retrieve a structure containing the attribute values of the current label and store the results in "lblatt". Print the contents of "lblatt". BugsSee the bugs pages on the ChIPS website for an up-to-date listing of known bugs. |
![]() |
The Chandra X-Ray
Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory. 60 Garden Street, Cambridge, MA 02138 USA. Email: cxcweb@head.cfa.harvard.edu Smithsonian Institution, Copyright © 1998-2004. All rights reserved. |