Skip navigation.
Home
The QNX Community Portal

View topic - how to access the gui by thread function?

how to access the gui by thread function?

Isn't the name clear?

how to access the gui by thread function?

Postby robert » Fri May 11, 2007 2:30 pm

Hola,

In a photon application i got a thread which is controling a network connection. I want to write out this connection state into a widget at a dialog. If the thread calls PtSetResource() the the application crashes. I think it is because of missing thread safenes.

How could i write out the state instead?

Here is the actual method which failed:
-->THREAD1:
PtMainLoop( );
// on press connect button, i start the connection thread
pthread_create(THREAD2);

-->THREAD2:
if( connection_state == changed)
PtSetResource(ABW_output_widget); // crashes the application
robert
Active Member
 
Posts: 15
Joined: Thu Aug 01, 2002 1:42 pm
Location: Germany

RE: how to access the gui by thread function?

Postby mario » Fri May 11, 2007 2:48 pm

Look at PtEnter and PtLeave, or have the second thread signal the first thread that some stuff needs to be refreshed.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

RE: how to access the gui by thread function?

Postby robert » Mon May 14, 2007 6:25 am

Thanks, i found the tutorial "Parallel Operations" right now.
robert
Active Member
 
Posts: 15
Joined: Thu Aug 01, 2002 1:42 pm
Location: Germany


Return to GUI Programming

Who is online

Users browsing this forum: No registered users and 1 guest