Background thread, async and GUI (dlangui)

Bagomot bagomot at gmail.com
Fri Jul 8 08:04:45 UTC 2022


On Thursday, 7 July 2022 at 18:26:15 UTC, Ali Çehreli wrote:

Summing up your help and GrimMaple, I understood how to make the 
file download progress bar beautifully. Thank you!

I only have a question with how I can work with the GUI from 
other threads. For example, in my application I have a button 
(GUI) that starts a long running job. As I understand it, it 
should run it in a separate thread so as not to block the GUI.

I did it through Thread, but now I realized that there are more 
convenient ways through Task.

But I do not understand how I can manage the GUI from that 
separate task. For example, I start the task with the button and 
block the button press (without blocking the entire GUI), it does 
its job and unblocks the button.

This is where help is needed. How is it fundamentally correct to 
do this in D, and how to do it in general with dlangui?


More information about the Digitalmars-d-learn mailing list