Trying to migrate from PyQt with Kivy and I cant even imagine a solution for this.
I have thousands of lines of code that use Qt's dialogues for text input. That is, when their line of code is reached, they 'stop' the script until the "ok" button is pressed, so they can return the text input.
Kivy doesnt have that functionality, so ideally, when the program needs user input, the "ok" button would call for the next function to run.
Therefore I must replace all the current calls to a PyQt function with a function that stops the running script, launches a working responsive dialogue, then resumes the original when it has the text input it requested. So the question is:
Is there a way to stop a running script until a function finishes, without hanging the GUI?
I have already tried:
- Threading:
Even if I start the text input in a new thread:
t = threading.Thread(target=TextInput.waiter)
the function that calls such thread will return just after calling the text input. If I use this code:
t.start()
t.join()
The main script will stop, but also hangs the text input GUI.
While/Sleep: Waiting for the text input variable to contain a valid result. But this blocks the ongoing textinput GUI in Kivy
Hacking raw_input: Currently thinking into try some hack with that, that would allow me to stop the script, then feed back the input found by the kivy text input popup.
Any pointers would be really welcome, thanks for reading.