In my main window is a button and a label. If the button is pressed I want to change the label and start a request (In the code below, the request is represented as the for loop). Unfortunally, when trying to change the label on the Button press the API/For-Loop has to finish. After they have finished the label changes it's text. Example code