Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wxPython panel color does not match with frame background

While using wxPython in creating GUI for Windows, I am encountering a problem where the wx.Panel's background colour and parent frame's background colours are not matching (one is light gray while the other one is of darker hue). However, this is not evident in Linux with the same code. How can I match the two different background colours in Windows? The embedded screenshot may give a fair idea of what I am talking about. !Screenshot of the GUI1

like image 373
Pradeep Pillai Avatar asked Jul 12 '26 04:07

Pradeep Pillai


1 Answers

Create a container panel that has the wx.Frame as parent (hence you get the light gray background color for the frame).
Use this panel as parent for all widgets contained in the frame.

Edit: the only reason is that default background color for frames is dark grey on Windows, see WxFAQ.

like image 162
kraymer Avatar answered Jul 14 '26 17:07

kraymer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!