Re: [fltk.coredev] About mixing Fl::awake(Fl_Awake_Handler, void*) and Fl::awake(void*)

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.coredev  ]
Previous Message ]New Message | Reply ]Next Message ]

Re: About mixing Fl::awake(Fl_Awake_Handler, void*) and Fl::awake(void*) Albrecht Schlosser Jul 06, 2021 top right image
On Am 7/6/21 11:07 PM schrieb imm wrote:
On Tue, 6 Jul 2021, 21:55 Albrecht Schlosser wrote:

The static variable is the problem, independent of any interaction or incompatibility with the other form of Fl::awake(). Since there is only one static variable callling Fl::thread_message() later in user code can only retrieve the last value assigned to this variable. Hence Fl::awake(void* message) is IMHO always unreliable unless you know that messages are queued infrequently, i.e. less than can be handled by events. A user moving the mouse permanently would likely lead to an "event overflow" dropping messages, whereas Fl::awake(F, message) queues all messages so no message can ever be lost.

Well, strictly the queue holds the last 1024 messages.

Got me! ;-)

Once it is full, older messages will be lost to make room for newer ones... But if the user code is lagging 1000 events behind then there are bigger problems I'd hazard....

I agree.

I was never really clear why the "old" method wasn't adapted to use the queue, though.
Perhaps it was so that legacy code would still behave in the same manner or something?

Or because nobody thought of it or took a stab at it?

This was indeed a thought I had when I wrote my message above. Wouldn't it be useful to queue Fl::awake(message) pointers in a similar way (FIFO)? Fl::thread_message() would then retrieve the first queued message. If we wanted to keep compatibility we could limit the FIFO to exactly one entry as a user option. void Fl::awake_message_queue_length(int).

You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Direct Link to Message ]
bottom left image   bottom right image
Previous Message ]New Message | Reply ]Next Message ]

Comments are owned by the poster. All other content is copyright 1998-2023 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to ''.