Centos 7.4, Python 3.6.8, wxPython 4.1.0
import wx
app = wx.App()
myFrame = wx.Frame(None, title="")
myPanel = wx.Panel(myFrame)
myStaticText = wx.StaticText(myPanel, label="Hello World")
mySizer = wx.BoxSizer(wx.VERTICAL)
mySizer.Add(myStaticText, wx.SizerFlags().Center())
myPanel.SetSizer(mySizer)
myFrame.Show()
#myFrame.Freeze()
app.MainLoop()
While running the above code, a widget appears with the text "Hello World" visible. However, if the code is run with the commented line uncommented, a completely black widget will be displayed. Why does this Freeze call change the widget display? Freeze is supposed to prevent any updates to the widget display.
Dependencies: gtk3-devel, libXtst-devel, libtiff-devel, gcc gcc-c++ epel-release, libGLU-devel
Freeze()
is supposed to temporarily suppress updating the display while you're modifying the widget repeatedly, in order to avoid unnecessary intermediate refreshes and the resulting flicker, but the widget must be thawed to allow it to redraw properly eventually. Leaving it frozen will prevent it from being updated, just as you observe.Normally you will rarely, if ever, need to use this method. It's an optimization and definitely not something you ever have to use.