I\'m working on an application that has a start and stop button. These buttons block the UI, and for various reasons, I can\'t spawn a thread.
I\'ve been showing a w
Try g_main_context_pending(NULL)
and g_main_context_iteration(NULL,FALSE)
instead of gtk_events_pending()
, the later is deprecated.
It could be a timing issue that kicks in (it oculd be that your loop kicks in before any events are registered to the mainloop, and thus instantly exits) - but this is just wild guessing due to lack of code.
The break condition is also wrong, you do not want to exit as soon as all events are processed at a specific point of time, you want to continue until long-run-ops are done.
That means you need to signal when your operation is done, check that flag in the loop you currently use and use blocking mode of the *_iteration(...)