[new function/changeset] thought/request for ishandle()
Ben Abbott
bpabbott at mac.com
Mon Oct 13 21:18:22 CDT 2008
On Oct 12, 2008, at 1:43 PM, Ben Abbott wrote:
> I've encountered several instances it the graphics m-files where
> handles for figures are verified by
>
> ishandle (h)
>
> or
>
> isfigure (h)
>
> Just as often it would be useful to verify a figure represents some
> other "type" of object. Checking for the other object properties
> would also simplify programing.
>
> I'd like to inquire as to opinions of modifying ishandle() to
> include additional property/value pairs. For example the equivalent
> to isfigure(h) would be
>
> isfigure (h) -> ishandle (h, "type", "figure")
>
> A check for an axes handle
>
> ishandle (h, "type", "axes")
>
> For a text handle
>
> ishandle (h, "type", "text")
>
> To find the pair of overlayed axes for plotyy where the
>
> hax = findobj (hfig, "type", "axes");
> ca = get (hfig, "currentaxes");
> ax = hax (ishandle (hax, "type", "axes", "position", get (ca,
> "position")));
>
> Rather than including optional property pairs with ishandle(),
> perhaps a new function should be written?
>
> ishandle_with_prop (h, "prop1", value1, "prop2", value2, ...)
>
> In the event of the latter, a m-file can be written (a task I'd be
> happy to take on), for the former the built-in would need to be
> modified.
>
> Thoughts?
>
> Ben
Please consider the attached changeset for the new function
ishandle_with_props().
ishandle_with_prop (h, "prop1", value1, "prop2", value2, ...)
My intent is that it be used to verify axes handles. I'm prepared to
apply it to the existing m-files provided it is accepted. The files
I've identified as the present are: axes.m , cla.m, colorbar.m,
comet.m, hold.m, plotmatrix.m, plotyy.m, & colorbar.m.
With the exception of colorbar() which looks for an image handle, the
others seek an axes handle. In the case of plotyy looking for an axes
handle with a specific "position" would be useful.
Ben
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: changeset-ishandle_with_props.txt
Url: https://www-old.cae.wisc.edu/pipermail/octave-maintainers/attachments/20081013/ae515f25/attachment.txt
-------------- next part --------------
More information about the Octave-maintainers
mailing list