[wxPython] wxGridCellAttr

The following script produces an illegal op error message.

Is the usage incorrect?

Colin W.
from wxPython.wx import *
from wxPython.grid import *

# Create a cell attribute
#~ Documentation
#~ wxGridCellAttr::wxGridCellAttr
#~ wxGridCellAttr()

#~ Default constructor. wxGridCellAttr(const wxColour& colText,
    #~ const wxColour& colBack,
    #~ const wxFont& font,
    #~ int hAlign,
    #~ int vAlign)

attr = wxGridCellAttr()

#print `attr.GetFont()`
print `attr.GetBackgroundColour()`
print 'done'

        #~ Either line attribute reference reports an illegal operation:

        #~ PYTHONW caused an invalid page fault in
        #~ module WXMSW232H.DLL at 0137:00f57b3a.
        #~ Registers:
        #~ EAX=74416c80 CS=0137 EIP=00f57b3a EFLGS=00010212
        #~ EBX=00000003 SS=013f ESP=006dfa18 EBP=006dfa1c
        #~ ECX=74416c80 DS=013f ESI=015a7630 FS=4197
        #~ EDX=015b5ec0 ES=013f EDI=01677e2c GS=0000
        #~ Bytes at CS:EIP:
        #~ 8a 40 0c 8b e5 5d c3 cc cc cc cc cc cc cc cc cc
        #~ Stack dump:
        #~ 74416c80 006dfa28 010542f2 74416c6c 006dfa34 0105d3af 74416c6c
006dfa40
0105d3d6 015b5ec0 006dfae8 01677eeb 00000004 008008c0 016a7278 00000000

attr = wxGridCellAttr()

#print `attr.GetFont()`
print `attr.GetBackgroundColour()`
print 'done'

        #~ Either line attribute reference reports an illegal operation:

It's a bug, I'll check in a fix. In the meantime you can work around it by
using the HasFont and etc. methods to check if there is one set in the Attr
object before trying to Get it.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!