[wxPython] Two additional wxHtmlWindow questions

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[wxPython] Two additional wxHtmlWindow questions

Pieter Claerhout-3
Hello,

I have again two additional questions about the wxHtmlWindow
control. I found out that the up/down arrows and the page up and
page down keys don't work to scroll through the contents of the
wxHtmlWindow. This does work for the wxTextCtrl. Is this due to
a limitation of the wxHtmlWindow? Is there a way to catch those
keystrokes in wxPython, and to do a scroll in the wxHtmlWindow?

My second question is if there is an easy way to get the contents
of a wxHtmlWindow without the HTML tags, much like you can do
a save as text from your browser?

Kind regards,


Pieter

Pieter Claerhout - [hidden email]
Response Center - Applications Support

Creo Europe - Excelsiorlaan 21 - 1930 Zaventem - Belgium
Tel: +32 (2) 711 14 00 - Fax: +32 (2) 720 96 71


_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] Two additional wxHtmlWindow questions

Robin Dunn
> I have again two additional questions about the wxHtmlWindow
> control. I found out that the up/down arrows and the page up and
> page down keys don't work to scroll through the contents of the
> wxHtmlWindow. This does work for the wxTextCtrl. Is this due to
> a limitation of the wxHtmlWindow? Is there a way to catch those
> keystrokes in wxPython, and to do a scroll in the wxHtmlWindow?
>

Looking at the wxHtmlWindow code I find that it does have a key down event
handler, so if you are not seeing any key handling it is probably because the
window does not have the focus.  Try calling the window's SetFocus method.


> My second question is if there is an easy way to get the contents
> of a wxHtmlWindow without the HTML tags, much like you can do
> a save as text from your browser?
>

You can get the HTML and then parse it with htmllib.HTMLParser from the
Ptyhon library.

--
Robin Dunn
Software Craftsman
[hidden email]
http://AllDunn.com/robin/
http://AllDunn.com/wxPython/  Check it out!



_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users