I recently added support for a figure/axes enter/leave event.  The
figure enter and axes enter/leave are easy to do with nothing new in
the backends, just using the native mpl events.  The figure leave
event is harder, because when a user leaves a figure and activates
another window, mpl gets no events.

To correct this, I added a leave_notify_event method to
backend_bases.FigureCanvasBase (note this is not an mpl Event) but
when called it will trigger a callback to those registered to the
figure_leave_event with the last event that occurred in the window.

I added support for this in gtk by connecting the the gtk signal
'leave_notify_event' to the mpl backend method leave_notify_event.  If
you know something about tk, wx or qt event handling, could you add a
similar method to the appropriate backend?  You can follow the example
in backend_gtk.


You can test with examples/event_handling/figure_axes_enter_leave.py

Thanks,
JDH

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to