HtmlCell.Find not working

Hi,

I’m using HtmlWindow, and I want to get the position of some anchor. I try to find that cell first:

top_cell = self.GetInternalRepresentation()
cell = top_cell.Find(wx.html.HTML_COND_ISANCHOR, ‘foobar’)

But it doesn’t work:

Traceback (most recent call last):
File “wxweb.py”, line 42, in
cell = top_cell.Find(wx.html.HTML_COND_ISANCHOR, ‘foobar’)
File “/usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/html.py”, line 720, in Find
return _html.HtmlCell_Find(*args, **kwargs)
TypeError: in method ‘HtmlCell_Find’, expected argument 3 of type ‘void const *’

Does anyone have any idea about it?

Thanks!

Try passing None for the param arg instead of 'foobar'. I've not sure if it's even used in any of the cell classes.

···

On 11/14/12 8:21 AM, taikou wrote:

Hi,

I'm using HtmlWindow, and I want to get the position of some anchor. I
try to find that cell first:

top_cell = self.GetInternalRepresentation()
cell = top_cell.Find(wx.html.HTML_COND_ISANCHOR, 'foobar')

But it doesn't work:

Traceback (most recent call last):
   File "wxweb.py", line 42, in <module>
     cell = top_cell.Find(wx.html.HTML_COND_ISANCHOR, 'foobar')
   File
"/usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/html.py", line
720, in Find
     return _html.HtmlCell_Find(*args, **kwargs)
TypeError: in method 'HtmlCell_Find', expected argument 3 of type 'void
const *'

Does anyone have any idea about it?

--
Robin Dunn
Software Craftsman

Hi Robin,

It returns None if param is set to be None. I looked at the source code and param is compared with m_AnchorName for anchor cell.

What if we parsed the object as wxString instead of void ptr?

···

On Friday, November 16, 2012 12:50:49 AM UTC-5, Robin Dunn wrote:

On 11/14/12 8:21 AM, taikou wrote:

Hi,

I’m using HtmlWindow, and I want to get the position of some anchor. I

try to find that cell first:

top_cell = self.GetInternalRepresentation()

cell = top_cell.Find(wx.html.HTML_COND_ISANCHOR, ‘foobar’)

But it doesn’t work:

Traceback (most recent call last):

File “wxweb.py”, line 42, in

 cell = top_cell.Find(wx.html.HTML_COND_ISANCHOR, 'foobar')

File

“/usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/html.py”, line

720, in Find

 return _html.HtmlCell_Find(*args, **kwargs)

TypeError: in method ‘HtmlCell_Find’, expected argument 3 of type 'void

const *’

Does anyone have any idea about it?

Try passing None for the param arg instead of ‘foobar’. I’ve not sure
if it’s even used in any of the cell classes.


Robin Dunn

Software Craftsman

http://wxPython.org

It's a void pointer in C++ because in theory it should be able to use any data type to find a matching cell, depending on what the class of the target cell is using for checking if it is a match. Unfortunately I can't think of a good way to support this in Classic wxPython, although it will be fairly easy in Phoenix. Sorry.

···

On 11/16/12 6:37 AM, taikou wrote:

Hi Robin,

It returns None if param is set to be None. I looked at the source code
and param is compared with m_AnchorName for anchor cell.

What if we parsed the object as wxString instead of void ptr?

--
Robin Dunn
Software Craftsman

Thanks Robin, I’ll just try some other methods.

···

On Tuesday, November 20, 2012 1:49:26 PM UTC-5, Robin Dunn wrote:

On 11/16/12 6:37 AM, taikou wrote:

Hi Robin,

It returns None if param is set to be None. I looked at the source code

and param is compared with m_AnchorName for anchor cell.

What if we parsed the object as wxString instead of void ptr?

It’s a void pointer in C++ because in theory it should be able to use
any data type to find a matching cell, depending on what the class of
the target cell is using for checking if it is a match. Unfortunately I
can’t think of a good way to support this in Classic wxPython, although
it will be fairly easy in Phoenix. Sorry.


Robin Dunn

Software Craftsman

http://wxPython.org