I'm fairly new to python(only couple weeks learning) and I'm finishing my first application using python 3.6 and Pyqt5 for GUI. It consists in a blockchain wallet for my boss' company's private blockchain. I have everything working right(miracle if You ask me). I'm using threads so the GUI doesn't get frozen when the blockchain's API takes long to process. So I have this piece of code
def modalCreateAddress():
name, ok = QInputDialog.getText(None, 'Name the address', 'Enter the address name:')
if ok:
_thread.start_new_thread(createAddress, (password, name))
This function createAddress as it seems, pretty obviously, calls the API for a new address creation, it sometimes takes a couple seconds but as it is on a thread the user is free to keep using the GUI and the function just looks like its not working. I wonder how I can manage to have a sort of loading indicator like "Generating new address..." or something like that. What's the best way to approach this situation? Maybe a little progress bar, or loading gif overlay? Would I have to get some sort of callback from the thread so I know when to hide the loading warning? If so, how can I do it?