I have a module that deals with complicated text manipulation. Because of limitations in StyledText, I must use TextAreas to do some of this. It’s done in an invisible window and works well. But of course when I call any of these functions from a thread I get an error because I’m manipulating a UI control. I can’t figure out any way around this limitation – since TextAreas can’t be instantiated outside of a window, they can’t be called from threads. Am I correct that there is no solution?
what types of functions are you trying to do… The only StyledText function that I found that insists on a TextArea is DRAWBLOCK… anydthing else can be done with just an ST object.
You could create an interim timer that calls the functions in the main thread and sets a result property. The thread would loop/sleep while it waits for the timer to complete.
StyledText fails in that it resets all styles to default as soon as you touch any text in the text run. I’ve filed bug reports/feature requests about this, but there is no indication it will be addressed.
Yes, I thought of a timer and blocking the thread, but it’s a terrible kludge and prone to break. I may have to resort to such tricks, or just disallow these functions in threads.