I have a matplotlib script that generates several figures. When a figure receives an event, how do I know which figure it did it? For example, the key event 'w' is meant to close the figure, but so far, I have no way to control which figure gets closed.
In the pick_event_demo.py example, each figure is connected to an event handler specific to it. I think this wouldn't work in my case because I don't know how many figures I'd have until I process some data. In any case, all my event handlers can be independent of the figure generating the event. They just need to know which figure to refer to. My work-around right now is to save the canvas attributes from all the figure handle. I compare this canvas to the canvas attribute of the event. When I found a match, I know I have the right figure. This seems kludgey, especially after most of the figures have been closed. I'd appreciate any help or pointers. Brian ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users