Re: transition to FOX 1.7 FXGUISignal
Jeroen <[email protected]>
| Newsgroups | gmane.comp.lib.fox-toolkit.user |
|---|---|
| Message-ID | <[email protected]> |
On Mon, 21 Feb 2022 07:32:48 +0100 Francesco Abbate <[email protected]> wrote: >Dear all, > >I am transitioning some of my applications to FOX 1.7. I stumbled on a >problem, one of my application is using the class FXGUISignal but this >latter no longer exists. > >For the moment I wasn't able to figure out what should I use instead, I >would appreciate some help. Also I looked for some documentation to >transition from Fox 1.6 but I didn't found any information on the website >neither in the source code. Use FXMessageChannel. It works better than the old FXGUISignal. FXMessageChannel is essentially an asynchronous message from a thread to the GUI thread [via its event loop system]. In a nutshell: 1) Create an FXMessageChannel This will create a pipe and [on Windows, a semaphore]. 2) Implement message handler in the object you want to send a message to. 3) Send a message to this object from a thread: messagechannel->message(target,message,data,size); 4) The target will be called via the FXMessageChannel, when the main GUI loop wakes up [which happens when its pipe has some data [on Windows, when the semaphore is signaled]. FXMessageChannel::onMessage will pull the message, its optional data, and dispatch to the target object. You can pass any data you want, but keep it small: it is passed through the pipe. Hope this helps, -- JVZ -- +----------------------------------------------------------------------------+ | Copyright (C) 08:20 02/21/2022 Jeroen van der Zijp. All Rights Reserved. | +----------------------------------------------------------------------------+