wxWidgets中提供wxWindowUpdateLocker来禁止重绘wxWindow,代码如下:
void MyFrame::Foo()
{
m_text = new wxTextCtrl(this, ...);
wxWindowUpdateLocker noUpdates(m_text);
m_text->AppendText();
... many other operations with m_text...
m_text->WriteText();
}
Using this class is easier and safer than calling Freeze and Thaw because you don't risk to forget calling the latter.