I think on Windows you must create and show() and destroy all windows in 
the same thread as you are running the main loop in. If you start the 
thread and have it create all the windows it should be ok.

On other platforms it does not care which thread things are created in. 
You can run the main loop in one thread, then stop and start running it 
in another thread, with no problems.

Peer-Timo Bremer wrote:
>> Note also that it is (generally) only the creating, mapping,
>> destroying of widgets that is restricted - you can manipulate a pre-
>> existing widget from any thread (suitable locking provided, of course!)
> 
> Hmm,
> 
> the creating and destroying is not too much of a problem and I would be 
> willing to jump through quite some hoops to create them in whatever way 
> works. My primary issue seems to be the mainloop . In my case I cannot start 
> the mainloop in the main thread (which potentially already runs the mainloop 
> of another gui for example). So I tried creating all my windows in the main 
> thread but letting the mainloop run in it's own child thread. However, this 
> seems to mess with the event system and the window never gets the focus.
> 
>> Al alternate is to run the GUI in a different process (rather than a
>> different thread) but then the communication to/from the GUI becomes
>> more complex. That might suit your needs better though?
>>
> 
> Unfortunately, this is not an option because I need to share memory between 
> the threads and cannot afford to transfer data via a socket or the like.
> 
> Thank for the
> 
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to