Re: Initializing the GUI from a different thread

Michael Behrisch <[email protected]>
Newsgroups gmane.comp.lib.fox-toolkit.user
Message-ID <[email protected]>
Hi Jeroen and all,
thanks for the quick answer!

Am 25.02.22 um 18:04 schrieb [email protected]:
> On 2022-02-25 09:48, Michael Behrisch wrote:
>> Dear all,
>> I have a question concerning setting up a multi threaded application.
>> We have an application (https://github.com/eclipse/sumo) which works
>> well if we initialize the FXApp and the main window from the main
>> thread but it I use another thread to initialize the GUI it does not
>> work any longer. The problem is that the application spawns more
>> threads which communicate with the main window using an event queue
>> (from the FXEX package:
>> https://github.com/eclipse/sumo/blob/main/src/utils/foxtools/FXThreadEvent.h) 
>>
>> but the main windows does not seem to get the signals any longer if we
>> start it from the secondary thread. The problem occurs only on
>> Windows, on Linux it works fine.
>>
>> We are using FOX 1.6.57 and any idea is welcome.
> 
> I always *strongly* discourage letting any other thread than the
> main GUI thread perform any GUI operations.
> 
> Reason is, on Windows, only the main thread can receive windows.

Just for my understanding: This means under windows it always needs to 
be the main thread which calls FXApp::run?

Best regards,
Michael
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.