place a wxPopupWindow based on pick event location

I'm hoping to get help from matplotlib wxPython backend users...

I'm struggling to get what is described in the subject line to work correctly.
There was a sort of similar thread from 2006 here:

http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg00945.html

I want to pick a point on a plot and use the x,y of that point to
place a wxPopupWindow
right near that point on the graph. I am doing this in wxPython as an embedded
graph). I have it working *somewhat* but there is still a major
problem with it.
I tried to base this off the wxPython demos wxPopupWindow code, but somehow
it is not working right.

Before I post any code or if I can get a runnable sample going, does anyone
have a pointer to a simple solution? I can get x and y in pixel space on the
graph from event.mouseevent.x and event.mouseevent.y, but then when I try
to sort of add those to the position of the frame which contains the panel
(which contains the graph), I get some really weird behavior when I move that
frame to the left: the location of the popupwindow jumps to the far right side
of the screen.

Any help is appreciated--Thanks!

Warning: the following is based on MPL 0.90.1 (yeah, I know, but it
works. We have a branch that works with 0.98 but it hasn't been merge
back in. Your mileage may vary.)

Our popup code does:

(note that in the bit below, self is a subclassed object based on
FigureCanvasWxAgg)

mouseLocation = wx.GetMousePosition()
pos = self.ScreenToClient(mouseLocation)
height = self.figure.bbox.height()
x = pos.x
y = height - pos.y

(pickType, pickDetails) = self._pick(x,y) # NB: This is a custom pick
routine written before the new pick code

....

self.popup = ProbePopupWindow(self, wx.SIMPLE_BORDER,
series.getName(), mouseLocation)

where ProbePopupWindow is a subclass of wx.PopupWindow, and the
positioning bit in the __init__ is:

self.Position(mouseLocation, (10,10))

HTH,
Anthony.

ยทยทยท

On Tue, Sep 23, 2008 at 3:28 PM, C M <cmpython@...287...> wrote:

I'm hoping to get help from matplotlib wxPython backend users...

I'm struggling to get what is described in the subject line to work correctly.
There was a sort of similar thread from 2006 here:

http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg00945.html

I want to pick a point on a plot and use the x,y of that point to
place a wxPopupWindow
right near that point on the graph. I am doing this in wxPython as an embedded
graph). I have it working *somewhat* but there is still a major
problem with it.
I tried to base this off the wxPython demos wxPopupWindow code, but somehow
it is not working right.