Hello!
If the constructor of the wx.ClientDC class is called with None (instead
of a canvas) as the only argument, it will cause a segmentation fault.
Is that the expected behavior?
I stumbled across this while playing with OGL and a meaningful Exception
would have saved me quite some time.
Regards,
Daniel Hepper
Hi Daniel,
If the constructor of the wx.ClientDC class is called with None (instead
of a canvas) as the only argument, it will cause a segmentation fault.
Is that the expected behavior?
I stumbled across this while playing with OGL and a meaningful Exception
would have saved me quite some time.
From the docs:
"""
wxClientDC::wxClientDC
wxClientDC(wxWindow* window)
Constructor. Pass a pointer to the window on which you wish to paint.
"""
I believe it's normal that it crashes, isn't it?
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/
···
On 5/7/07, Daniel Hepper wrote:
It is, but we don't live in a perfect world, so this might be a
possible enhancement in error-handling for future versions of
wxPython.
I have no idea if this should be fixed at the C++ level or directly in
wxPython, but I am sure Robin will accept a patch 
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/
···
On 5/7/07, Grzegorz Adam Hankiewicz wrote:
Andrea Gavana wrote:
> On 5/7/07, Daniel Hepper wrote:
>> If the constructor of the wx.ClientDC class is called with None (instead
>> of a canvas) as the only argument, it will cause a segmentation fault.
>> Is that the expected behavior?
>
> [...]Constructor. Pass a pointer to the window on which you wish to paint.
>
> I believe it's normal that it crashes, isn't it?
You could argue raising an assertion is more well behaved than a
segmentation fault.
Robin Dunn wrote:
Andrea Gavana wrote:
>> Andrea Gavana wrote:
>> >> If the constructor of the wx.ClientDC class is called with None
>> (instead
>> >> of a canvas) as the only argument, it will cause a segmentation fault.
>> >> Is that the expected behavior?
>> >
>> > [...]Constructor. Pass a pointer to the window on which you wish to
>> paint.
>> >
>> > I believe it's normal that it crashes, isn't it?
>>
>> You could argue raising an assertion is more well behaved than a
>> segmentation fault.
Looks like it is already asserting everywhere except on Mac. Is that
the platform you are using?
No, I'm using version 2.8.3, the prebuilt binary for Ubuntu 7.04 from
the wxPython repositories.
···
> On 5/7/07, Grzegorz Adam Hankiewicz wrote:
>> > On 5/7/07, Daniel Hepper wrote: