Next: Managing Default Properties, Previous: Graphics Object Properties, Up: Graphics Data Structures [Contents][Index]
Find graphics object with specified property values.
The simplest form is
findobj (prop_name, prop_value)
which returns the handles of all objects which have a property named prop_name that has the value prop_value. If multiple property/value pairs are specified then only objects meeting all of the conditions are returned.
The search can be limited to a particular set of objects and their descendants, by passing a handle or set of handles hlist as the first argument.
The depth of the object hierarchy to search can be limited with the
"-depth" argument. An example of searching only three generations
of children is:
findobj (hlist, "-depth", 3, prop_name, prop_value)
Specifying a depth d of 0, limits the search to the set of objects
passed in hlist. A depth d of 0 is equivalent to the
"flat" argument.
A specified logical operator may be applied to the pairs of prop_name
and prop_value. The supported logical operators are:
"-and", "-or",
"-xor", "-not".
Objects may also be matched by comparing a regular expression to the
property values, where property values that match
regexp (prop_value, pattern) are returned.
Finally, objects may be matched by property name only by using the
"-property" option.
Implementation Note: The search only includes objects with visible
handles (HandleVisibility = "on"). See findall, to
search for all objects including hidden ones.
Find graphics object, including hidden ones, with specified property values.
The return value h is a list of handles to the found graphic objects.
findall performs the same search as findobj, but it
includes hidden objects (HandleVisibility = "off"). For full
documentation, see findobj.
Next: Managing Default Properties, Previous: Graphics Object Properties, Up: Graphics Data Structures [Contents][Index]