How do I add "background text" into MDI parent frame, the text will be now erased if I move the MDI Parent frame, or I can also erase text with moving MDI Child frame, need to somehow refresh the text, how to do it?
wx.FULL_REPAINT _ON_RESIZE style on MDI parent frame would help a little, but I would also need to call self.Layout() (and I still can erase the text moving child frame over the text...)
[code=python]
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import wx
class MyFrame(wx.MDIP arentFrame):
def __init__(self):
wx.MDIParentFra me.__init__(sel f, None, title="testing" , id=-1, size=(400, 400), style=wx.DEFAUL T_FRAME_STYLE | wx.FRAME_NO_WIN DOW_MENU)
background_text = wx.StaticText(s elf, id=-1, label="This is background text", style=wx.ALIGN_ RIGHT)
background_text .SetBackgroundC olour("#BB0000" )
vbox = wx.BoxSizer(wx. VERTICAL)
vbox.AddSpacer( (1,1),1)
vbox.Add(backgr ound_text, 0, wx.ALL|wx.ALIGN _RIGHT, 5)
self.SetAutoLay out(True)
self.SetSizer(v box)
self.Layout()
child_frame = wx.MDIChildFram e(self, -1, "MDI child", size=(150,150))
child_frame.Sho w(True)
app = wx.PySimpleApp( )
MyFrame().Show( )
app.MainLoop()
[/code]
wx.FULL_REPAINT _ON_RESIZE style on MDI parent frame would help a little, but I would also need to call self.Layout() (and I still can erase the text moving child frame over the text...)
[code=python]
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import wx
class MyFrame(wx.MDIP arentFrame):
def __init__(self):
wx.MDIParentFra me.__init__(sel f, None, title="testing" , id=-1, size=(400, 400), style=wx.DEFAUL T_FRAME_STYLE | wx.FRAME_NO_WIN DOW_MENU)
background_text = wx.StaticText(s elf, id=-1, label="This is background text", style=wx.ALIGN_ RIGHT)
background_text .SetBackgroundC olour("#BB0000" )
vbox = wx.BoxSizer(wx. VERTICAL)
vbox.AddSpacer( (1,1),1)
vbox.Add(backgr ound_text, 0, wx.ALL|wx.ALIGN _RIGHT, 5)
self.SetAutoLay out(True)
self.SetSizer(v box)
self.Layout()
child_frame = wx.MDIChildFram e(self, -1, "MDI child", size=(150,150))
child_frame.Sho w(True)
app = wx.PySimpleApp( )
MyFrame().Show( )
app.MainLoop()
[/code]