Re: Initializing the GUI from a different thread
Michael Behrisch <[email protected]>
| Newsgroups | gmane.comp.lib.fox-toolkit.user |
|---|---|
| Message-ID | <[email protected]> |
Hi, Am 01.03.22 um 18:14 schrieb Wuping Xin: > After you create the App object, did you call application.init? Yes, I did that. I simply moved all the code which is usually in main() into the run method of the thread. > > Check this out > https://docs.microsoft.com/en-us/windows/win32/winmsg/using-messages-and-message-queues?redirectedfrom=MSDN > > "The system does not automatically create a message queue for each > thread. Instead, the system creates a message queue only for threads > that perform operations which require a message queue" > "You create a message loop by using the *GetMessage* > <https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getmessage>and > *DispatchMessage* > <https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-dispatchmessage>functions." > <---------- FxApp makes calls to these two (or equivalents) inside > FxApp.Init. > > I am not sure about your case, but it is definitely doable to put UI in > a separate worker thread on Windows. I believe you would need some > tweaks for your thread creation code. Thank you, I will have a look whether I can work that out. Best regards, Michael _______________________________________________ Foxgui-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/foxgui-users