Consider this class:
class BriefMessage(wx.Panel):
""" Briefly display a parent-centered message """
def __init__(self, parent, msg, msec=750):
wx.Panel.__init__(self, parent, -1, style=wx.RAISED_BORDER)
st = wx.StaticText(self, -1, ' %s ' % msg, style=wx.ALIGN_CENTER )
st.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.BOLD))
st.SetBackgroundColour('BLUE')
st.SetForegroundColour('CYAN')
st.SetPosition((-2,7))
(w,h) = st.GetBestSize()
st.SetSize ((w+20,h+20))
self.SetSize((w+20,h+20))
self.SetBackgroundColour('BLUE' )
self.Center()
self.Show()
wx.CallLater(msec, self.Done)
def Done(self): self.Destroy()
···
------------------------------------------------------------------------------
This works well in most situations, but in some cases -- cases having no pattern I've been able to discern -- all that's displayed is the panel border, with the screen content underlying the panel showing through, i.e., it behaves as if the panel interior is transparent.
What am I overlooking here??
Bob
P.S. My apologies if you get this twice. My initial try, which I posted four hours ago, has yet to show up here.