octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [new function/changeset] thought/request for ishandle()


From: Ben Abbott
Subject: Re: [new function/changeset] thought/request for ishandle()
Date: Mon, 13 Oct 2008 22:18:22 -0400


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

Attachment: changeset-ishandle_with_props.txt
Description: Text document




reply via email to

[Prev in Thread] Current Thread [Next in Thread]