HtmlCell.Find not working

42 views
Skip to first unread message

taikou

unread,
Nov 14, 2012, 11:21:31 AM11/14/12
to wxpytho...@googlegroups.com
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?

Thanks!

Robin Dunn

unread,
Nov 16, 2012, 12:50:42 AM11/16/12
to wxpytho...@googlegroups.com
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

taikou

unread,
Nov 16, 2012, 9:37:51 AM11/16/12
to wxpytho...@googlegroups.com
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

unread,
Nov 20, 2012, 1:49:19 PM11/20/12
to wxpytho...@googlegroups.com
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.

taikou

unread,
Nov 20, 2012, 3:23:20 PM11/20/12
to wxpytho...@googlegroups.com
Thanks Robin, I'll just try some other methods.
Reply all
Reply to author
Forward
0 new messages