views:

313

answers:

1

Hi,

I got a wxWidgets form with a progress bar on it and i update the progress from a thread using my own custom wxWidget event. This works fine except the fact is the form only shows the progress update when i move the mouse. I have tried adding Refresh() and Update() after the new progress value is set but with no luck.

Am i doing something wrong or is this a glitch with wxWidgets?

Windows 7 visual studio 2005 c++

Edit:

This is my current thread callback:

EVENT_CALLBACK_PTR_CPP(onProgress, UploadProgPage)
{
    updateInfo* temp = static_cast<updateInfo*>(ptr);

    if (temp)
    {
     wxOnUploadUpdateEvent event(wxEVT_UPLOAD_UPDATE, GetId(), temp, UPDATE_PROGRESS);
     event.SetEventObject(this);
     GetEventHandler()->AddPendingEvent(event);
    }
}

And the progress update:

void UploadProgPage::onUpdate(wxOnUploadUpdateEvent &event)
{
    if (event.type == UPDATE_PROGRESS)
    {

     m_pbProgress->SetValue(event.info->precent);
     Refresh(false);
    }
}
+1  A: 

I worked it out. Its because of SetTopWindow(); When i remove this line from my app all events are processed in due time.

Lodle