change the text color in wxDataViewListCtrl Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
chenbin.sh
Experienced Solver
Experienced Solver
Posts: 64
Joined: Fri Apr 17, 2009 7:15 am
Location: Sydney, Australia
Contact:

change the text color in wxDataViewListCtrl

Post by chenbin.sh » Sat Apr 12, 2014 7:40 am

https://dl.dropboxusercontent.com/u/858 ... 91x436.png


See the button text "Open" is in black color, how can I change it to white?
help me, help you.
http://blog.binchen.org

User avatar
doublemax
Moderator
Moderator
Posts: 15655
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: change the text color in wxDataViewListCtrl

Post by doublemax » Sat Apr 12, 2014 9:46 am

How do you draw the button?

If you draw it yourself, you can set the color with wxDC::SetTextForeground()
http://docs.wxwidgets.org/trunk/classwx ... f3049849d6
Use the source, Luke!

chenbin.sh
Experienced Solver
Experienced Solver
Posts: 64
Joined: Fri Apr 17, 2009 7:15 am
Location: Sydney, Australia
Contact:

Re: change the text color in wxDataViewListCtrl

Post by chenbin.sh » Sun Apr 13, 2014 3:37 am

Thanks, I think it's because I'm using wxDataViewCustomRenderer:RenderText() on gtk+, for some reason, the text color is hardcoded in that function.

I just use wxDC->DrawLabel instead and it works as expected.
help me, help you.
http://blog.binchen.org

Post Reply