Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » PromptOK in a thread. Bug?
PromptOK in a thread. Bug? [message #26749] Tue, 25 May 2010 17:49 Go to next message
whiteman is currently offline  whiteman
Messages: 11
Registered: May 2009
Promising Member
If I launch a

PromptOK("Hello");

from a thread my program doesn't continue to work (like a blocked mutex), no crash.
Re: PromptOK in a thread. Bug? [message #26752 is a reply to message #26749] Tue, 25 May 2010 20:36 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Hello whiteman

I do not remember why but Mirek advised us to use user interface only in main thread.


Best regards
IƱaki
Re: PromptOK in a thread. Bug? [message #26753 is a reply to message #26749] Tue, 25 May 2010 21:05 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi whiteman,

Do you use GuiLock when calling that PromptOK? It is necessary if you want to access the GUI directly from other threads.

See reference/GuiLock and reference/GuiMT...

Honza
Re: PromptOK in a thread. Bug? [message #26759 is a reply to message #26752] Wed, 26 May 2010 13:25 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
koldo wrote on Tue, 25 May 2010 14:36

Hello whiteman

I do not remember why but Mirek advised us to use user interface only in main thread.


Actually, that has changed with GuiLock. So the only thing concerning the main thread now is the fact that you do not need to use GuiLock there Smile

Hard to say why in this case it fails. A testcase and more info about host OS would be helpful.

Also, please check whether reference/GuiLock works for you (it creates Prompts inside thread).

Thinking about it, there is one important thing to know: All GUI processing is performed in the main thread. So if you invokde PromptOK from another thred, the request is passed to the main thread to be actually executed - in a very similar way to GUI input events. So if your main thread is busy doing things (think infinite loop), Prompt request will never be processed and things will look blocked.


[Updated on: Wed, 26 May 2010 13:32]

Report message to a moderator

Re: PromptOK in a thread. Bug? [message #26762 is a reply to message #26759] Wed, 26 May 2010 13:54 Go to previous message
whiteman is currently offline  whiteman
Messages: 11
Registered: May 2009
Promising Member
Ok, thanks to all of you!

[Updated on: Wed, 26 May 2010 13:57]

Report message to a moderator

Previous Topic: Howto use the Updater
Next Topic: layout bug with glctrl
Goto Forum:
  


Current Time: Fri Apr 19 05:41:42 CEST 2024

Total time taken to generate the page: 0.02289 seconds