octave-maintainers
[Top][All Lists]
Advanced

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

thought/request for ishandle()


From: Ben Abbott
Subject: thought/request for ishandle()
Date: Sun, 12 Oct 2008 13:43:17 -0400

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


reply via email to

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