Window freezes/gui not responding while a function is busy doing something

I am using ofxImGui with Openframeworks.My problem is, while a function is busy doing some file i/o operations(using C++ file i/o functions directly instead of OF ones), the program window/gui freezes until the function stops file i/o operations.When I use a progressBar widget with ImGui, the progress bar renews itself only when those file i/o operations completely stops.And until that, the gui freezes, not responding.

For example, when I try to do same things in Qt Widgets, all I have to do is calling:
QCoreApplication::processEvents();

at the right place and it solves the problems, progress bar updates itself, no freeze.If I don’t use that line in Qt, the same window/gui freeze problems happen.Using C++ Builder, the same problem was solved by a similar function.

Is there a similar function in Openframeworks or ofxImGui?If not, what may be the solution?

Using ofThread for the function solved the problem.

1 Like