2.9.3.1 and GetSize for dc exception

I am seeing the following exception when trying to Print Preview from within an ObjectListView.

   File "c:\Python27\lib\site-packages\ObjectListView\ListCtrlPrinter.py", line 604, in OnPreparePrinting
     self.SetScaleAndBounds(dc)
   File "c:\Python27\lib\site-packages\ObjectListView\ListCtrlPrinter.py", line 643, in SetScaleAndBounds
     dw, dh = dc.GetSize()
AttributeError: 'PySwigObject' object has no attribute 'GetSize'

With wxPython 2.9.3.1.

When I try it in the demo I get the following:
Traceback (most recent call last):
   File "PrintFramework.py", line 64, in OnPrintPage
     (w, h) = dc.GetSizeTuple()
AttributeError: 'PySwigObject' object has no attribute 'GetSizeTuple'

Werner

Where is the dc coming from? It looks like it hasn't had a proxy wx.DC instance wrapped around it like it should. Can you duplicate it in the print framework sample or other printing sample code?

···

On 1/30/12 8:34 AM, werner wrote:

I am seeing the following exception when trying to Print Preview from
within an ObjectListView.

File "c:\Python27\lib\site-packages\ObjectListView\ListCtrlPrinter.py",
line 604, in OnPreparePrinting
self.SetScaleAndBounds(dc)
File "c:\Python27\lib\site-packages\ObjectListView\ListCtrlPrinter.py",
line 643, in SetScaleAndBounds
dw, dh = dc.GetSize()
AttributeError: 'PySwigObject' object has no attribute 'GetSize'

With wxPython 2.9.3.1.

When I try it in the demo I get the following:
Traceback (most recent call last):
File "PrintFramework.py", line 64, in OnPrintPage
(w, h) = dc.GetSizeTuple()
AttributeError: 'PySwigObject' object has no attribute 'GetSizeTuple'

--
Robin Dunn
Software Craftsman

I can't recreate the first in the demo, but the second exception is from the demo when run PrintFrameWork and click on the Print Preview button - the errors shows in the console window.

If that is not enough I'll dig in the OLV code on Wednesday my time.

Werner

···

On 30/01/2012 20:50, Robin Dunn wrote:

On 1/30/12 8:34 AM, werner wrote:

I am seeing the following exception when trying to Print Preview from
within an ObjectListView.

File "c:\Python27\lib\site-packages\ObjectListView\ListCtrlPrinter.py",
line 604, in OnPreparePrinting
self.SetScaleAndBounds(dc)
File "c:\Python27\lib\site-packages\ObjectListView\ListCtrlPrinter.py",
line 643, in SetScaleAndBounds
dw, dh = dc.GetSize()
AttributeError: 'PySwigObject' object has no attribute 'GetSize'

With wxPython 2.9.3.1.

When I try it in the demo I get the following:
Traceback (most recent call last):
File "PrintFramework.py", line 64, in OnPrintPage
(w, h) = dc.GetSizeTuple()
AttributeError: 'PySwigObject' object has no attribute 'GetSizeTuple'

Where is the dc coming from? It looks like it hasn't had a proxy wx.DC instance wrapped around it like it should. Can you duplicate it in the print framework sample or other printing sample code?

In 2.9 the print framework is rather broken. The introduced
internal scaling is destroying in your back, all the good
work you may have correctly programmed. The real preview
size has no more meaning.

Drawing objects are shifted, assuming they are printed!

It just becomes impossible to print correctly a
y = 0 line in a x-y coordinate system.

Example

Blue rectangle: coordinate system
Red lines: "scientific" data
Top: wx2.8
Bottom: wx2.9

Sorry, after n attempts I do not know how to
put a link to imageshack. Google is somehow refusing it.

jmf

···

On 30 jan, 22:54, werner <wbru...@free.fr> wrote:

On 30/01/2012 20:50, Robin Dunn wrote:

Thanks. I'll take a closer look at that later today.

···

On 1/30/12 1:54 PM, werner wrote:

On 30/01/2012 20:50, Robin Dunn wrote:

On 1/30/12 8:34 AM, werner wrote:

I am seeing the following exception when trying to Print Preview from
within an ObjectListView.

File "c:\Python27\lib\site-packages\ObjectListView\ListCtrlPrinter.py",
line 604, in OnPreparePrinting
self.SetScaleAndBounds(dc)
File "c:\Python27\lib\site-packages\ObjectListView\ListCtrlPrinter.py",
line 643, in SetScaleAndBounds
dw, dh = dc.GetSize()
AttributeError: 'PySwigObject' object has no attribute 'GetSize'

With wxPython 2.9.3.1.

When I try it in the demo I get the following:
Traceback (most recent call last):
File "PrintFramework.py", line 64, in OnPrintPage
(w, h) = dc.GetSizeTuple()
AttributeError: 'PySwigObject' object has no attribute 'GetSizeTuple'

Where is the dc coming from? It looks like it hasn't had a proxy wx.DC
instance wrapped around it like it should. Can you duplicate it in the
print framework sample or other printing sample code?

I can't recreate the first in the demo, but the second exception is from
the demo when run PrintFrameWork and click on the Print Preview button -
the errors shows in the console window.

--
Robin Dunn
Software Craftsman

Hi Robin,

···

Subject:
Re: [wxPython-users] 2.9.3.1 and GetSize for dc exception
Date:
Tue, 31 Jan 2012 09:28:33 -0800
From:
Robin Dunn
Reply-To:
To:
robin@alldunn.comwxpython-users@googlegroups.comwxpython-users@googlegroups.com


On 1/30/12 1:54 PM, werner wrote:
> On 30/01/2012 20:50, Robin Dunn wrote:
>> On 1/30/12 8:34 AM, werner wrote:
>>> I am seeing the following exception when trying to Print Preview from
>>> within an ObjectListView.
>>>
>>> File "c:\Python27\lib\site-packages\ObjectListView\ListCtrlPrinter.py",
>>> line 604, in OnPreparePrinting
>>> self.SetScaleAndBounds(dc)
>>> File "c:\Python27\lib\site-packages\ObjectListView\ListCtrlPrinter.py",
>>> line 643, in SetScaleAndBounds
>>> dw, dh = dc.GetSize()
>>> AttributeError: 'PySwigObject' object has no attribute 'GetSize'
>>>
>>> With wxPython 2.9.3.1.
>>>
>>> When I try it in the demo I get the following:
>>> Traceback (most recent call last):
>>> File "PrintFramework.py", line 64, in OnPrintPage
>>> (w, h) = dc.GetSizeTuple()
>>> AttributeError: 'PySwigObject' object has no attribute 'GetSizeTuple'
>>
>>
>> Where is the dc coming from? It looks like it hasn't had a proxy wx.DC
>> instance wrapped around it like it should. Can you duplicate it in the
>> print framework sample or other printing sample code?
> I can't recreate the first in the demo, but the second exception is from
> the demo when run PrintFrameWork and click on the Print Preview button -
> the errors shows in the console window.
Thanks. I'll take a closer look at that later today.
-- Robin Dunn
Software Craftsman
I just run into this with demo from SVN.
Is the fix for this in 2.9.4? Or did it maybe fall of the list.
Werner

http://wxPython.org :slight_smile:

I don't remember specifically, but it seems to be working fine in my current trunk workspace. The change would have to have been a change made in the C++ wrapper code, so just getting a fresh copy of the demo would not help it.

···

On 3/17/12 10:38 AM, werner wrote:

Hi Robin,

-------- Original Message --------
Subject: Re: [wxPython-users] 2.9.3.1 and GetSize for dc exception
Date: Tue, 31 Jan 2012 09:28:33 -0800
From: Robin Dunn <robin@alldunn.com>
Reply-To: wxpython-users@googlegroups.com
To: wxpython-users@googlegroups.com

On 1/30/12 1:54 PM, werner wrote:

On 30/01/2012 20:50, Robin Dunn wrote:

On 1/30/12 8:34 AM, werner wrote:

I am seeing the following exception when trying to Print Preview from
within an ObjectListView.

File "c:\Python27\lib\site-packages\ObjectListView\ListCtrlPrinter.py",
line 604, in OnPreparePrinting
self.SetScaleAndBounds(dc)
File "c:\Python27\lib\site-packages\ObjectListView\ListCtrlPrinter.py",
line 643, in SetScaleAndBounds
dw, dh = dc.GetSize()
AttributeError: 'PySwigObject' object has no attribute 'GetSize'

With wxPython 2.9.3.1.

When I try it in the demo I get the following:
Traceback (most recent call last):
File "PrintFramework.py", line 64, in OnPrintPage
(w, h) = dc.GetSizeTuple()
AttributeError: 'PySwigObject' object has no attribute 'GetSizeTuple'

Where is the dc coming from? It looks like it hasn't had a proxy wx.DC
instance wrapped around it like it should. Can you duplicate it in the
print framework sample or other printing sample code?

I can't recreate the first in the demo, but the second exception is from
the demo when run PrintFrameWork and click on the Print Preview button -
the errors shows in the console window.

Thanks. I'll take a closer look at that later today.

I just run into this with demo from SVN.

Is the fix for this in 2.9.4? Or did it maybe fall of the list :-).

--
Robin Dunn
Software Craftsman