Get clicked word in wxHtmlWindow

Dear all,

I would like to click on any word displayed in an wxHtmlWindow, and get the word itself so that I can, e.g., display its definition to the user. Using the following code, I can get a ref to the 'cell' containing the word that was clicked on:

class HtmlWindow(wxHtmlWindow):
     def __init__(self, win, id, loc, size, style):
         wxHtmlWindow.__init__(self, win, id, loc, size, style)

     def OnCellClicked(self, cell, x, y, event):
         print 'cell, x, y, event:', cell, x, y, event

But how do I get the text of the word contained in the cell? So far as I can tell, wxHtmlCell objects do not have a method to return their HTML contents.

Or is this the right way to go about things?

Thanks in advance for any assistance,

Ed.

···

---
Edward H. Hagen Institute for Theoretical Biology
phone: +49/30 2093-8649 Humboldt-Universität zu Berlin
fax: +49/30 2093-8801 Invalidenstraße 43
http://itb.biologie.hu-berlin.de/~hagen 10115 Berlin, Germany

I don't believe the functionality you seek exists in the wx.HtmlWindow widget.

It is possible to locate find words near the mouse in a multi-line wx.TextCtrl on the Windows platform, but that may not be a route you wish to go.

-Joe

Edward Hagen wrote:

···

Dear all,

I would like to click on any word displayed in an wxHtmlWindow, and get the word itself so that I can, e.g., display its definition to the user. Using the following code, I can get a ref to the 'cell' containing the word that was clicked on:

class HtmlWindow(wxHtmlWindow):
    def __init__(self, win, id, loc, size, style):
        wxHtmlWindow.__init__(self, win, id, loc, size, style)

    def OnCellClicked(self, cell, x, y, event):
        print 'cell, x, y, event:', cell, x, y, event

But how do I get the text of the word contained in the cell? So far as I can tell, wxHtmlCell objects do not have a method to return their HTML contents.

Or is this the right way to go about things?

Thanks in advance for any assistance,

Ed.

---
Edward H. Hagen Institute for Theoretical Biology
phone: +49/30 2093-8649 Humboldt-Universität zu Berlin
fax: +49/30 2093-8801 Invalidenstraße 43
http://itb.biologie.hu-berlin.de/~hagen 10115 Berlin, Germany

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org