Re: Re: Way to determine if I am running on main fltk's thread
Gonzalo Garramuño
Feb 28, 2021
El 28/2/21 a las 12:04, lifeatt...@gmail.com escribió:
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();
}
}
Oh yes! std::thread::id! Had completely forgotten about it. One gets
so immersed in fltk that forgets that the rest of C++ exists :D
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.