Creating Graphical User Interfaces |
Properties that Affect Component Access
HandleVisibility
The HandleVisibility
property controls access to a component's handle. This property determines when a component's handle is accessible in its parent's list of children. When a handle is not accesible in a parent's list of children, it is not returned by functions that obtain handles by searching the object hierarchy or querying handle properties with functions such as get
, findobj
, gca
, gcf
, gco
, newplot
, cla
, clf
, and close
. Neither is the handle accessible in the parent figure's CurrentObject
property.
Handles that are hidden are still valid. If you know a component's handle, you can set
and get
its properties, and pass it to any function that operates on handles.
HandleVisibility
is on
.
HandleVisibility
to callback
causes handles to be accessible from within callback routines or functions invoked by callback routines, but not from within functions invoked from the command line. This provides a means to protect GUIs from command-line users, while allowing callback routines to have complete access to the handles.
HandleVisibility
to off
makes handles inaccessible at all times. This may be necessary when a callback routine invokes a function that might potentially damage the GUI (such as evaluating a user-typed string), and so temporarily hides its own handles during the execution of that function.
You can set the root ShowHiddenHandles
property to on to make all handles accessible, regardless of their HandleVisibility
settings. This does not affect the values of the HandleVisibility
properties.
Properties that Affect Callback Execution | Examples of Callbacks for GUI Components |
© 1994-2005 The MathWorks, Inc.