Retrieve a property value from a graphics entity or an User Interface object.
h=get(prop)
val=get(h,prop)
val=h.prop
: :prop character string name of the property. : :val value of the property. :
This routine can be used to retrieve the value of a specified property from a graphics entity or a GUI object. In this case it is equivalent to use the dot operator on a handle. For exemple, get(h,”background”) is equivalent to h.background.
Property names are character strings. To get the list of all existing properties see graphics_entities or uicontrol for User Interface objects.
get function can be also called with only a property as argument. In this case, the property must be one of the following:
:
// for graphics entities
`clf`_()
// simple graphics objects
`subplot`_(121);
x=[-.2:0.1:2*%pi]';
`plot2d`_(x-2,x.^2);
`subplot`_(122);
`xrect`_(.2,.7,.5,.2);
`xrect`_(.3,.8,.3,.2);
`xfarc`_(.25,.55,.1,.15,0,64*360);
`xfarc`_(.55,.55,.1,.15,0,64*360);
`xstring`_(0.2,.9,"Example <<A CAR>>");
h=get("current_entity") //get the newly object created
h.font_size=3;
f=get("current_figure") //get the current figure
f.figure_size
f.figure_size=[700 500];
f.children
f.children(2).type
f.children(2).children
f.children(2).children.children.thickness=4;
a=get("current_axes") //get the current axes
a.children.type
a.children.foreground //get the foreground color of a set of graphics objects
a.children.foreground=9;
// for User Interface objects
h=`uicontrol`_('string', 'Button'); // Opens a window with a button.
p=get(h,'position'); // get the geometric aspect of the button
`disp`_('Button width: ' + `string`_(p(3))); // print the width of the button
`close`_(); // close figure