Ozy="""<html ><head></head><body>
Ozymandias - I met a traveler from an antique land<br>
Who said two vast and trunkless legs of stone<br>
</body></html>"""
wx._core.PyAssertionError: C++ assertion "wxAssertFailure at
..\..\..src\msw\toplevel.cpp(301) in
wxTopLevelWindowMST::MSWGetParent() : wxFRAME_FLOAT_ON_PARENT but no
parent?
Has anyone else seen anything else like this? Any clues?
Ozy="""<html ><head></head><body>
Ozymandias - I met a traveler from an antique land<br>
Who said two vast and trunkless legs of stone<br>
</body></html>"""
wx._core.PyAssertionError: C++ assertion "wxAssertFailure at
..\..\..src\msw\toplevel.cpp(301) in
wxTopLevelWindowMST::MSWGetParent() : wxFRAME_FLOAT_ON_PARENT but no
parent?
Has anyone else seen anything else like this? Any clues?
The error is an Assertion error, assertions are used as warnings to
tell the programmer that they are doing something wrong. It says the
window is using a style that requires it to have a Parent window. You
created your HtmlEasyPrinting object by specifying None to the
parentWindow argument, it needs to have a parent window assigned to
it.
Cody
Thank you very much for this. I have a couple of comments.
1) All my users and I are convinced that this was working perfectly
until a few weeks ago, when I recreate the .exes. I wonder how it
managed to work coded like that?
2) I think p495 of the wxPython in Action book is a bit misleading.
The example given has 'parentWindow=None' in it and the accompanying
text led me to think that the parentWindow was not an important field.
Having said all that, I will keep an eye open for this in future.
Thanks again.
rgds
phil
···
On Jun 24, 8:32 am, Cody Precord <codyprec...@gmail.com> wrote:
Hi,
On Wed, Jun 23, 2010 at 1:42 PM, Philip Ellis <philipjel...@gmail.com> wrote:
> This code gets a nasty error.
> import wx
> import wx.html
> Ozy="""<html ><head></head><body>
> Ozymandias - I met a traveler from an antique land<br>
> Who said two vast and trunkless legs of stone<br>
> </body></html>"""
> wx._core.PyAssertionError: C++ assertion "wxAssertFailure at
> ..\..\..src\msw\toplevel.cpp(301) in
> wxTopLevelWindowMST::MSWGetParent() : wxFRAME_FLOAT_ON_PARENT but no
> parent?
> Has anyone else seen anything else like this? Any clues?
The error is an Assertion error, assertions are used as warnings to
tell the programmer that they are doing something wrong. It says the
window is using a style that requires it to have a Parent window. You
created your HtmlEasyPrinting object by specifying None to the
parentWindow argument, it needs to have a parent window assigned to
it.
Cody
Thank you very much for this. I have a couple of comments.
1) All my users and I are convinced that this was working perfectly
until a few weeks ago, when I recreate the .exes. I wonder how it
managed to work coded like that?
I haven't looked to see if anything has changed but its possible that
the style flags for the dialog that the html easy print uses may have
changed in recent releases or that the assert in the toplevel window
class was previously not there.
2) I think p495 of the wxPython in Action book is a bit misleading.
The example given has 'parentWindow=None' in it and the accompanying
text led me to think that the parentWindow was not an important field.
I agree that it is misleading, if it is a required parameter it should
not be specified as a keyword param unless it is there to maintain
compatibility with earlier versions of the class that didn't require a
parent window.
Cody
···
On Thu, Jun 24, 2010 at 12:36 PM, Philip Ellis <philipjellis@gmail.com> wrote:
Cody
Thank you very much for this. I have a couple of comments.
1) All my users and I are convinced that this was working perfectly
until a few weeks ago, when I recreate the .exes. I wonder how it
managed to work coded like that?
Were you using a different version then?
2) I think p495 of the wxPython in Action book is a bit misleading.
The example given has 'parentWindow=None' in it and the accompanying
text led me to think that the parentWindow was not an important field.
Keep in mind that the book is over 4 years old now, which is almost an eternity in the tech world. Most things in the book are still correct but little details will certainly be changing over time. In this case I expect that either the float on parent style for the print preview window or the assert was added recently. BTW, the wx C++ docs also still indicate that not passing a parent window is ok...