Pregunta

Obtuve un formulario wxWidgets con una barra de progreso y actualizo el progreso desde un hilo usando mi propio evento wxWidget personalizado. Esto funciona bien, excepto que el formulario solo muestra la actualización de progreso cuando muevo el mouse. Intenté agregar Refresh () y Update () después de establecer el nuevo valor de progreso, pero sin suerte.

¿Estoy haciendo algo mal o es un problema técnico con wxWidgets?

Windows 7 visual studio 2005 c ++

Editar:

Esta es mi devolución de llamada de hilo actual:

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);
    }
}

Y la actualización de progreso:

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

        m_pbProgress->SetValue(event.info->precent);
        Refresh(false);
    }
}
¿Fue útil?

Solución

Lo resolví. Es por SetTopWindow (); Cuando elimino esta línea de mi aplicación, todos los eventos se procesan a su debido tiempo.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top