Question

Appropriate code provided below. I had this working once but have since messed up due to having to change some of the other code. Can't figure out what I've done. The encrypt function creates a thread and makes a call to function EncryptProc to process one or more files. Once each file is completed it should print the name to a textctrl. In the codes current state it waits until all threads/files are processed before printing. It then prints evrything in one go. During processing the textctrl also completely disappears. Any help would be much appreciated as its starting to drive me nuts, lol.

---EDIT--- CODE REMOVED

Was it helpful?

Solution

There should be no GUI access from within threads - in your case EncryptProc is writing to the text control directly - you need to either:

  1. Use CallAfter in the thread to update the text control after the thread exits or
  2. Raise custom event an event in the thread that carries the file name information and have a hander in the main thread that updates the text control on receiving the event.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top