Hi,
I have the following problem. I'm building a wxpython application with a wxmpl PlotPanel. My ultimate need is to catch the X and Y graph coordinates of points I'm clicking on the graph. While using pylab this is almost trivial, it seems not if I'm using an embedded PlotPanel...
I've tried to mpl_connect the figure object to the button_click_event, this way:
···
---
[...]
self.control=wxmpl.PlotPanel(self,1)
def click_me(mpl_event):
print 'you click me!'
if mpl_event.inaxes:
print 'in axes too!'
disconnect_id=self.control.mpl_connect('button_press_event',click_me)
print 'id:',disconnect_id
[...]
---
I receive an id from the mpl_connect method, but the click_me function is never called.
In the WxMPL documentation I also found this:
---
button_press_event(self, x, y, button, guiEvent=None)
Backend derived classes should call this function on any mouse button press. x,y are the canvas coords: 0,0 is lower, left. button and key are as defined in MouseEvent
---
but I'm really unsure of its meaning/use. It is something to trap the wx.EVT_LEFT_DOWN?
I'm lost. Any help will be appreciated.
Massimo