I have a problem with printing html when it contains wx Buttons etc.
I am using wxPython 2.1.11 It leads to an access violation under
Windows NT. Also, I get the same error when attempting to print the
html window with widgets. I tried searching in the archives and a
similar problem is mentioned by
>2: (Severe error) Select "Overview \ Non-Managed Windows \ =
>wxHTMLWindow". Click on "With Widgets", now click on "Print". The =
>"Print" dialog will appear. Click "OK". The application crashes with
>a= dialog headed "Printing pythonw.exe - Application Error". The
>text =contained in this dialog reads "The instruction at 0x00928841
>referenced = memory at 0x00000000. The memory could not be read".
>Note that if "Show = Default" is selected and printed, a
>fine-looking printed document is = produced.
The access violation I get is not precisely what Werner reports.
Robin said the following about Werner's problem
>Thanks for the info. Neither of these suprises me, but obviously I
>didn't think to test them.
May I ask whether this problem has been solved in further interim
releases of wxPython? At the moment I have an application in which I
am using wxPython to provide me with my lecture `slides' (including
interactive ones) for my philosophy of science class. The students
have access to the application and can print off copies of my
straightforward` slides', but they cannot print `slides' that have
buttons etc. embedded in them.
University of Dundee
[hidden email] tel 01382 344539
> May I ask whether this problem has been solved in further interim
> releases of wxPython? At the moment I have an application in which I
> am using wxPython to provide me with my lecture `slides' (including
> interactive ones) for my philosophy of science class. The students
> have access to the application and can print off copies of my
> straightforward` slides', but they cannot print `slides' that have
> buttons etc. embedded in them.
Here is a fix. In lib/wxpTag.py at the end of the HandlWxpTag change the
code to look like this:
# create the object
parent = self.GetParser().GetWindow()
obj = apply(self.ctx.classObj,
# add it to the HtmlWindow
self.ctx = None
This will simply ignore the widgets when printing. A better solution of
course would be to create an image of the widget and substitute that for the
widget when printing, but that's a non-trivial task since any arbitrary
window class can be used here...