|
|
I believe the "correct" solution is to use Fl::awake() to tell the main thread to perform some operation.
If you can use C++, then you could track thread ids yourself using #include <thread>
std::thread::id main_thread; main() { main_thread = std::this_thread; }
func() { if (std::this_thread == main_thread) { win.show(); } } On Sunday, February 28, 2021 at 8:46:57 AM UTC-5 ggar...@gmail.com wrote:
Is there a function to determine whether a piece of code is running on
the main fltk's thread?
Something like:
if ( Fl::main_thread() )
{
win.show();
}
else
{
// do nothing...
}
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/c1c94a90-f434-4ddc-ad5a-4d4fb0a92d4cn%40googlegroups.com.
[ Direct Link to Message ] | |
|
| |