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.
本文介绍了在wxWidgets中如何利用wxWindowUpdateLocker类来有效禁用wxWindow的重绘功能,相较于传统的Freeze和Thaw方法,这种方法更加简便且避免了忘记调用Thaw的风险。

181

被折叠的 条评论
为什么被折叠?



