On Wed, 11 Apr 2007 03:57:12 -0500, Julien Lemaitre <[EMAIL PROTECTED]> wrote:
> Hi, > >> How are you setting your custom event? I tried using the >> RegisterWindowMessage win32 function and the message is not processed >> by my custom message handler. > > My custom event is defined without RegisterWindowsMessage(), it's just a > const int. I've tried to use RegisterWindowsMessage() to, and in both > cases all messages sent with PostMessage() are actually handled by the > custom message handler. > That's good news for everyone but me. I'll have to look further into it. I recommend using RegisterWindowMessage as it is the documented way of getting a unique message for all apps running on that Windows OS. > >> However, if I watch fl_msg in an idle callback it is being received. > > The idle callback is a good idea, I'll remember it :) > Be careful with the idle callback as you'll only see the last message handled on that tick. You'll also not be guaranteed access to the parameters of that message. Here I only use it to check if the message was received. > >> So it seems the message is being handled before it is passed to the >> custom message handler callback. > > Not in my case. As the doc says, if no handle() method takes the > message, it is then dispatched to callbacks installed with add_handler(). > > >> I eventually used the WM_COPYDATA message as it fit my needs but I >> never tracked down what FLTK was doing with the message. >> Perhaps FLTK only accepts a certain range of messages for handling? > > I've briefly checked the code of the wait() function - actually, > fl_wait() - but I've seen nothing looking like a range condition. > > > I just wanted to know if add_handler() was the right way to handle > non-fltk messages..? > > Thanks :) > Julien To my knowledge, add_handler is the best way to handle all messages, including non-fltk messages. _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

