When matplotlib is embeded in a pyGTK application, how to make the NavigationToolbar2 key ('1' '2' 'a' 'g' ..) working??

Hi all,

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:
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.

How could I manage to make them work,
and/or,
where I should start in the source code to undestand how it work, that I could reproduce the shorkey behavior directly in my own application code?.

Thanks,

David

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.py (991 Bytes)

two_scales_embedded_in_gtk2.py (1.04 KB)