HtmlCell.Find not working
The group you are posting to is a
Usenet group . Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
From:
taikou <lrk... @gmail.com>
Date: Wed, 14 Nov 2012 08:21:31 -0800 (PST)
Local: Wed, Nov 14 2012 11:21 am
Subject: 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 <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!
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Robin Dunn <ro... @alldunn.com>
Date: Thu, 15 Nov 2012 21:50:42 -0800
Local: Fri, Nov 16 2012 12:50 am
Subject: Re: [wxPython-users] HtmlCell.Find not working
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?
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
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
taikou <lrk... @gmail.com>
Date: Fri, 16 Nov 2012 06:37:51 -0800 (PST)
Local: Fri, Nov 16 2012 9:37 am
Subject: Re: [wxPython-users] HtmlCell.Find not working
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 <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?
> 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
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Robin Dunn <ro... @alldunn.com>
Date: Tue, 20 Nov 2012 10:49:19 -0800
Local: Tues, Nov 20 2012 1:49 pm
Subject: Re: [wxPython-users] HtmlCell.Find not working
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
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
taikou <lrk... @gmail.com>
Date: Tue, 20 Nov 2012 12:23:20 -0800 (PST)
Local: Tues, Nov 20 2012 3:23 pm
Subject: Re: [wxPython-users] HtmlCell.Find not working
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
You must
Sign in before you can post messages.
You do not have the permission required to post.