[wxPython-users] bind popup menu to entries of HTMLListBox

Robin Dunn robin at alldunn.com
Sun Jun 18 13:22:17 PDT 2006


Kees wrote:
> Hi all,
> 
> I have a HTMLListBox in my app. that I would ideally like to show up a popup
> menu that is aware of the entry on which the right mouse button was pressed such
> that I can adjust the choices of the popup menu and furthermore take action
> knowing which entry recieved the right mouse button. Ideally I would also like
> to surpress the popup when the user right clicks on an empty area in the list,
> but this is probably easily done when I know how to obtain the first goal. 
> 
> I'm able to show the popup if (and only if) the right mouse is clicked on the
> HTMLListBox, but I can't take it any further. Any hints would be very welcome!

One of the base classes of wx.HtmlListBox has a HitTest(point) method 
that looks like is should do the job.  Have you tried that?

	item = self.HitTest(event.GetPosition())
	

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list