Although, having typed that, I remember you are using 1.1.7, and that
> mechanism may have been added since then. Have you looked at the
> mechanisms provided in 1.1.9 for comparison - I do believe the later
> versions are better.
>
> In summary; I've never found need to use thread_message, so you may not
> need to either. What is the problem you are trying to solve that needs
> it? Is there some other way?

Thanks Ian.  You're right in that the version of awake() that takes a callback 
was introduced in 1.1.9.  I actually did temporarily switch to 1.1.9 to see if 
using callbacks would help with my problem at hand (described below), and 
unfortunately it didn't.  But it didn't make things any worse, either, so once 
we upgrade to 1.1.9 (soon, I hope) I might use the awake/callback technique to 
handle my asynchronous gui updates.

The problem I was having was the problem with menu item hotkeys seeming to not 
work.  Since I was grasping at straws regarding the cause, I decided to try the 
awake/callback approach.

I actually have a lead on the root cause of the hotkey problem, and it makes me 
somewhat embarrassed to have made my earlier forum postings on the matter :/

When the original author of the app was having trouble with crashes, he guessed 
that he was having some kind of race condition regarding the gui operations, so 
he introduced a few mutexes to the app (he didn't know about Fl::lock() at the 
time).  He introduced a class called MY_LockableOutput, which is a child of the 
Fl_Output class, just adding mutexes.

When I sorted out the multithreading issues we were having with FLTK, I 
believed that MY_LockableOutput was no longer needed, and all instances of it 
could be replaced with Fl_Output.  What I didn't realize is that the class 
MY_LockableOutput also has another important method:
   int MY_LockableOutput::handle(int) { return 0; }
which I'm told will permit arrow key presses to propagate to the menu.  So 
restoring that approach is my next task.

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to