canvas objects

I've updated the 'contains' patch to handle figure enter/leave, at
least on wx backends, and fixed a minor hit test bug in ellipse.
I've also removed the special status of the pick event notifier,
using the mpl_connect event processing framework to handle it.

You can attach the enter/leave artist highlighting demo to a
figure using:

figure.canvas.mpl_connect("motion_notify_event",figure.canvas.hilite)

You can disable pick on a figure using:

    fig.canvas.mpl_disconnect(fig.canvas.button_pick_id)
    fig.canvas.mpl_disconnect(fig.canvas.scroll_pick_id)

Now I can work on an event handling framework which connects
directly to the artists rather than filtering all callbacks to
the same pick function. I'll mostly follow tk canvas handling
conventions unless anyone has suggests for a better approach.

   - Paul

···

On Sun, Jul 08, 2007 at 03:04:41AM -0400, Paul Kienzle wrote:

I submitted the 'contains' patch to the patch tracker on sourceforge.

Hey Paul, this is a very impressive piece of work. You weren't
kidding when you said you had a lot of work ahead of you in your first
post on the subject. The recent pick framework was a significant
improvement on what we had before it, which was barely usable, but
your stuff is going to make it *much* better. It is impressive that
your code doesn't break the existing API, but don't kill yourself over
maintaining API compatibiltiy. The pick_even was only added in the
0.90 release, and is still very lightly used. I would like to
preserve most of the functionality that is there (eg custom hit
testing functions, as you have) but if we need to tweak the API that
will be fine.

When you finish the architectural changes, I hope you'll provide us
with a nice example or two, and or modify the existing pick_event_demo
and data_browser code to use the cleaner API , eg registering with the
artist directly).

One minor bug I fixed for non wx backends in the (very cool)
figure.canvas.mpl_connect("motion_notify_event",figure.canvas.hilite)
functionality. gui_repaint is a wx only method, and I just commented
it out and replaced the "draw" with a draw_idle. This should work
across backends. Note draw_idle by default in backend_bases just
calls draw, but backends can override it to use their GUIs idle
handler. This is usually a good idea so you don't get an event pile
up. In particular, it is not implemented for backend_wx, so one of
you wx gurus/users may want to consider adding it, because for
interactive stuff like motion events, it can be a big win.

JDH

···

On 7/9/07, Paul Kienzle <pkienzle@...537...> wrote:

On Sun, Jul 08, 2007 at 03:04:41AM -0400, Paul Kienzle wrote:
> I submitted the 'contains' patch to the patch tracker on sourceforge.

I've updated the 'contains' patch to handle figure enter/leave, at
least on wx backends, and fixed a minor hit test bug in ellipse.
I've also removed the special status of the pick event notifier,
using the mpl_connect event processing framework to handle it.