Window freezing in Realized-Callback


I have a window that contains a PtList. This PtList gets its contents from the disk. Every time the window is (re)displayed this list has to be filled again.

At the moment this happens within the Realized-callback. Unfortunately this lets the whole window freeze in case there are very much data on the disk, no user input is possible until all these data are read.

My problem: I cannot put the procedure of loading data from disk and filling PtList into a thread because the function PtListAddItems() I use for that is not thread-safe. So is there an other way to do that? My intention is to have the user interface alive so that the user can see that something is happen hereā€¦