Thanks for the advice, but that doesn’t seem to be the problem. In my actual application,
this error is occurring consistently across Frames, Panels, and even the STC Editor.
The slightly larger demo application below (with a Panel added) shows the same issue
(http://imgur.com/odDOQmv)
It also looks like the problem isn’t in the hex string interpretation: replacing it with
wx.Colour(0, 43, 54) has no effect on the incorrect output.
Regards,
Matt
···
#!/usr/bin/env python
import wx
app = wx.App(False) # Create a new app, don’t redirect stdout/stderr to a window.
frame = wx.Frame(None, wx.ID_ANY, “Hello World”) # A Frame is a top-level window.
sizer = wx.BoxSizer(wx.VERTICAL)
panel = wx.Panel(frame, wx.ID_ANY, size=(100,100))
sizer.Add(panel, flag=wx.ALL, border=10)
panel.SetBackgroundColour(‘#002b36’)
frame.SetSizerAndFit(sizer)
frame.Show(True) # Show the frame.
app.MainLoop()
On Monday, May 20, 2013 6:28:17 PM UTC-4, Chris Barker - NOAA Federal wrote:
Frames can be a bit odd by themselves – you might try putting a Panel
on it and setting the BackgroundColour on the Panel.
-Chris
On Mon, May 20, 2013 at 2:01 PM, mkeeter matt.j...@gmail.com wrote:
I’m having trouble setting the background color of a wx.Frame. The color
displayed on my screen is not the color that I set using
SetBackgroundColour.
A very simple test program is below. I set the color to be to be #002b36,
but it
is displayed as #003945 (calling GetBackgroundColour still returns #002b36).
A screenshot of the miscolored frame is at http://imgur.com/bXfLKcM
I’m running Mac OS X 10.6.8, wxPython 2.9.4.0 osx-cocoa (classic).
Any suggestions?
Thanks,
Matt Keeter
#!/usr/bin/env python
import wx
app = wx.App(False) # Create a new app, don’t redirect stdout/stderr to a
window.
frame = wx.Frame(None, wx.ID_ANY, “Hello World”) # A Frame is a top-level
window.
frame.SetBackgroundColour(‘#002b36’)
frame.Show(True) # Show the frame.
app.MainLoop()
–
You received this message because you are subscribed to the Google Groups
“wxPython-users” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
–
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris....@noaa.gov