Hi, After quite some time (hours) digging source code, I finally understood how matplotlib and pylab handle the key pressed event. Finally I borrowed a piece if code from the FigureManagerBase class in backend_base.py and was successfull in reworking it to do what I expect :-) In attachement you will find a full working example.
David 2007/6/6, David Tremouilles <[EMAIL PROTECTED]>:
Hi, Back with same problem when embedding in gtk. I would like to enable the key pressed event (key '1' '2' 'a' 'g' .. ) of NavigationToolbar2 in my pyGTK app. (These keys shortcut are described here: (or see PS of this email) http://sourceforge.net/tracker/index.php?func=detail&aid=1432252&group_id=80706&atid=560722 ) The shorcuts work perfectly using pylab. But when I include matplotlib in my pyGTK app the shorcuts are broken. Example of the two version (pylab: two_scales.py and pygtk: two_scales_embedded_in_gtk2 ) are attached to this email. How could I manage to make them work ? Thanks for your help. David PS """ NavigationToolbar2 now manages overlapping axes correctly when the axes overlap like in two_scales.py, NavigationToolbar2 only managed one axe. For example, when zooming or panning, only the left y scale will move. With the patch, both axes will move. It is also possible to select only one axe by pressing a digit. pressing '1' will enable navigation (set_navigate()) only on the first axe under the cursor. pressing '2' will enable navigation only on the second axe under the cursor. Also, the LocationEvent.inaxes will behave accordingly. For example, pressing 'g' will enable the grid on the selected axe. pressing 'a' will reenable all axes under the cursor. """
two_scales_embedded_in_gtk2_soluce.py
Description: Binary data
------------------------------------------------------------------------- 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