[Phoenix] AttributeError: 'GeometryCentre' object has no attribute 'window'

I wanted to see if my program works with wxPython 2.9.5 (Phoenix). When adding a pane with an aui notebook i get this error:
AttributeError: ‘GeometryCentre’ object has no attribute ‘window’

Changing the version select in the script to 2.9.4 works without an error.

Is this a bug in Phoenix or is it because Phoenix isn’t yet complete?

AUI_test_Phoenix.py (1.19 KB)

Looks like a bug in Phoenix port of AUI.

Line 4706 in framemanager.py is the issue:

          if type(arg1) == type(1):

In 2.9.5 arg1 is an int but in Phoenix it is:

type(arg1)
<class 'wx._core.GeometryCentre'>

I don't know what the correct check would be, but I am sure Andrea or Robin will let us know.

Werner

···

On 01/04/2013 10:43, topix wrote:

I wanted to see if my program works with wxPython 2.9.5 (Phoenix). When adding a pane with an aui notebook i get this error:
AttributeError: 'GeometryCentre' object has no attribute 'window'

Changing the version select in the script to 2.9.4 works without an error.

Is this a bug in Phoenix or is it because Phoenix isn't yet complete?

werner wrote:

I wanted to see if my program works with wxPython 2.9.5 (Phoenix).
When adding a pane with an aui notebook i get this error:
AttributeError: 'GeometryCentre' object has no attribute 'window'

Changing the version select in the script to 2.9.4 works without an
error.

Is this a bug in Phoenix or is it because Phoenix isn't yet complete?

Looks like a bug in Phoenix port of AUI.

Line 4706 in framemanager.py is the issue:

if type(arg1) == type(1):

In 2.9.5 arg1 is an int but in Phoenix it is:

type(arg1)
<class 'wx._core.GeometryCentre'>

I don't know what the correct check would be, but I am sure Andrea or
Robin will let us know.

In Phoenix elements of C++ enums are now instances of a class with the same name as the enum. This is done to help detect cases where the wrong type of enum element is passed to C++ methods, or other type-safety related things. However this is not as complex as you may think because these enum classes are essentially just subclasses of int, so the test above could also be written as:

     if isinstance(arg1, int):

and it will work in either case. Or you could get more specific and verify that constants from the correct enum are being used, and check for the arg being an instance of the desired enum class.

···

On 01/04/2013 10:43, topix wrote:

--
Robin Dunn
Software Craftsman

I don’t understand what you said, that’s beyond my knowledge. :expressionless: But now i know what i must look for (and learn) :-). Thank you for your answer.

···

Torsten

Am Dienstag, 2. April 2013 02:43:30 UTC+2 schrieb Robin Dunn:

werner wrote:

On 01/04/2013 10:43, topix wrote:

I wanted to see if my program works with wxPython 2.9.5 (Phoenix).

When adding a pane with an aui notebook i get this error:

AttributeError: ‘GeometryCentre’ object has no attribute ‘window’

Changing the version select in the script to 2.9.4 works without an

error.

Is this a bug in Phoenix or is it because Phoenix isn’t yet complete?

Looks like a bug in Phoenix port of AUI.

Line 4706 in framemanager.py is the issue:

if type(arg1) == type(1):

In 2.9.5 arg1 is an int but in Phoenix it is:

type(arg1)

<class ‘wx._core.GeometryCentre’>

I don’t know what the correct check would be, but I am sure Andrea or

Robin will let us know.

In Phoenix elements of C++ enums are now instances of a class with the
same name as the enum. This is done to help detect cases where the
wrong type of enum element is passed to C++ methods, or other
type-safety related things. However this is not as complex as you may
think because these enum classes are essentially just subclasses of int,
so the test above could also be written as:

 if isinstance(arg1, int):

and it will work in either case. Or you could get more specific and
verify that constants from the correct enum are being used, and check
for the arg being an instance of the desired enum class.


Robin Dunn

Software Craftsman

http://wxPython.org

Hi Andrea,

auiframemanager.patch (492 Bytes)

auinotebook.py (1.29 KB)

···

On 02/04/2013 02:43, Robin Dunn wrote:

werner wrote:

On 01/04/2013 10:43, topix wrote:

I wanted to see if my program works with wxPython 2.9.5 (Phoenix).
When adding a pane with an aui notebook i get this error:
AttributeError: 'GeometryCentre' object has no attribute 'window'

Changing the version select in the script to 2.9.4 works without an
error.

Is this a bug in Phoenix or is it because Phoenix isn't yet complete?

Looks like a bug in Phoenix port of AUI.

Line 4706 in framemanager.py is the issue:

if type(arg1) == type(1):

In 2.9.5 arg1 is an int but in Phoenix it is:

type(arg1)
<class 'wx._core.GeometryCentre'>

I don't know what the correct check would be, but I am sure Andrea or
Robin will let us know.

In Phoenix elements of C++ enums are now instances of a class with the same name as the enum. This is done to help detect cases where the wrong type of enum element is passed to C++ methods, or other type-safety related things. However this is not as complex as you may think because these enum classes are essentially just subclasses of int, so the test above could also be written as:

    if isinstance(arg1, int):

and it will work in either case. Or you could get more specific and verify that constants from the correct enum are being used, and check for the arg being an instance of the desired enum class.

Made a patch for the above error, which makes the sample which topix did run - but I do see an artifact in the top left corner (small white line in the corner) which is not seen in 2.9.5 classic.

Werner

werner wrote:

Made a patch for the above error, which makes the sample which topix did
run -

Thanks.

but I do see an artifact in the top left corner (small white line
in the corner) which is not seen in 2.9.5 classic.

I don't see it on Mac. My Windows workspace is not fully up to date yet so I haven't been able to try it there.

···

--
Robin Dunn
Software Craftsman