contents up previous next

wxwindowupdatelocker

this tiny class prevents redrawing of a wxwindow during its lifetime by using wxwindow::freeze and thaw methods. it is typically used for creating automatic objects to temporarily suppress window updates before a batch of operations is performed:

    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.

derived from

none.

include files

<wx/wupdlock.h>

members

wxwindowupdatelocker::wxwindowupdatelocker
wxwindowupdatelocker::~wxwindowupdatelocker


wxwindowupdatelocker::wxwindowupdatelocker

wxwindowupdatelocker(wxwindow *win)

creates an object preventing the updates of the specified win. the parameter must be non-null and the window must exist for longer than wxwindowupdatelocker object itself.


wxwindowupdatelocker::~wxwindowupdatelocker

~wxwindowupdatelocker()

destructor reenables updates for the window this object is associated with.