HTMLViewer in main thread

My project requires an embedded HTML Viewer. It’s working great but there are a some tasks that take a few seconds to execute, and they block the HTML Viewer from updating. This causes some problems in the embedded java scripts.

Is there any way to allow the HTML Viewer to still get some CPU cycles?

Put the CPU intensive methods in threads.

I did. But they use declares and for whatever reason they block even when called from a thread.

Very frustrating.

In this case only a helper app helps. Those are a §$%& nuisance.

[quote=380212:@Chris Halford]I did. But they use declares and for whatever reason they block even when called from a thread.

Very frustrating.[/quote]
Keep in mind that Xojo threads are cooperative and that they still only run on a single core. If the method you are calling is synchronous, that is non-yielding, yes, your app will hang until there’s a response. The way most APIs that do allow asynchronous execution handle this is by way of a callback. You call the api and provide a pointer to a delegate which should be called when the process is done.

In Xojo, you could create a console app to do this long-running process and then execute it with an async shell.

Something less complex could be to put the HTMLViewer window in a second app as a helper, so it never gets halted.

You can communicate between the two apps with an IPCSocket.