fully populating GridCellAttr()??

32 views
Skip to first unread message

braide...@gmail.com

unread,
Apr 13, 2017, 7:57:23 AM4/13/17
to wxPython-users
One really important difference between 2.8 and Phoenix deals with the backend handling of GridCellAttr(). It appears that in 2.8, it is possible just to simply create the object and then override specific properties. In Phoenix, it appears that

my_attr=GridCellAttr()

creates an object with few or none of its attributes initialized.

Questions:

1. Is there some "best practice" way to fully populate the attributes?
2. Once these are created, should we do anything special during destruction?

Many Thanks, Eric

braide...@gmail.com

unread,
Apr 14, 2017, 9:47:33 AM4/14/17
to wxPython-users
Lesson - always remember to look at both wxPython and wxWidgets docs.

To POSSIBLY answer my own question 1:

        gr=My wx.Grid Object

        dch,dcv=gr.GetDefaultCellAlignment()
        dcbgc=gr.GetDefaultCellBackgroundColour()
        dcf=gr.GetDefaultCellFont()
        dctc=gr.GetDefaultCellTextColour()
        dce = gr.GetDefaultEditor()
        dcr = gr.GetDefaultRenderer()
        result = GridCellAttr() #new instance of GridCellAttr
        #Go through steps to decide whether or not to use default or override
        #must make sure to set these props, default or otherwise
        #renderer and editor require .IncRef(), according to my one example???

The good news for me, fully populating attributes eliminates the errors related to Null colors or Null Fonts or ...

The bad news, I am now getting an abrupt segfault, though this time it complains about refcounts - oops, different thread

Steve Barnes

unread,
Apr 15, 2017, 1:29:24 AM4/15/17
to wxpytho...@googlegroups.com


On 14/04/2017 14:47, braide...@gmail.com wrote:
> Lesson - always remember to look at both wxPython and wxWidgets docs.
>

I have found that the Phoenix docs are a lot better on this than the
original wxPython documents. If the is a specific area that is missing
it might be worth raising a ticket on the Phoenix documents so as to
keep track of what the problems might be.

--
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect
those of my employer.
Reply all
Reply to author
Forward
0 new messages