From: John H. <jd...@gm...> - 2008-11-26 19:05:28
|
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 |