I have created a subclass of wxHtmlWindow that handles <form> specially. I inserted a standard wxHtmlWindow into a wxFrame in the designer, saved it, then imported my subclass and changed wxHtmlWindow to htmlwindow.HtmlWindow (my subclass).
I immediately noticed that I could no longer manage my frame in the designer, I assume because Boa does not know how to display my HtmlWindow. I don't know whether to call this a bug or not. It would be nice if Boa at least left my code alone and drew a bounding box around my control on the Frame.
What are best practices for using modified controls? Do you build everything else in the Frame and then, when you're happy with that, make the modification last?
I can already see this causing problems if I want to create a modified container and place standard controls inside it, something wxPython will let me do but Boa will not...
Boa has built in support to handle this, please read the ExtendingBoa.html page in the documentation.
To do this you would use the "Custom Classes" feature.
* Don't use the htmlwindow.HtmlWindow form, import and use the name directly.
* Make sure your subclass has the exact same constructor parameters as the wxPython class you derive from.
Thanks riaan, although the trick I wanted was not in ExtendingBoa.html but in MixingSource.html. (grepping 'Custom Classes' found it.)
When I made the suggested changes and added _custom_classes to my wxFrame everything worked.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.