12.07.2015 Views

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

gcboPurpose2gcboReturn the handle of the object whose callback is currently executingSyntaxDescriptionRemarksSee Alsoh = gcbo[h, figure] = gcboh = gcbo returns the handle of the graphics object whose callback is executing.[h, figure] = gcbo returns the handle of the current callback object and thehandle of the figure containing this object.<strong>MATLAB</strong> stores the handle of the object whose callback is executing in theroot’s CallbackObject property. If a callback interrupts another callback,<strong>MATLAB</strong> replaces the CallbackObject value with the handle of the objectwhose callback is interrupting. When that callback completes, <strong>MATLAB</strong>restores the handle of the object whose callback was interrupted.The root CallbackObject property is read-only, so its value is always valid atany time during callback execution. The root CurrentFigure property, and thefigure CurrentAxes and CurrentObject properties (returned by gcf, gca, andgco respectively) are user settable, so they can change during the execution ofa callback, especially if that callback is interrupted by another callback.Therefore, those functions are not reliable indicators of which object’s callbackis executing.When you write callback routines for the CreateFcn and DeleteFcn of anyobject and the figure ResizeFcn, you must use gcbo since those callbacks do notupdate the root’s CurrentFigure property, or the figure’s CurrentObject orCurrentAxes properties; they only update the root’s CallbackObject property.When no callbacks are executing, gcbo returns [] (an empty matrix).gca, gcf, gco, rootobject2-205

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!