Skip navigation.
Home
The QNX Community Portal

View topic - How to break loop in callback functuion

How to break loop in callback functuion

Isn't the name clear?

How to break loop in callback functuion

Postby watcharin » Thu Oct 02, 2003 11:57 am

I use PtOnOffButton widget and call my callbackfunction when I click OnOffButton.
My callbackfunction have loop for example

int
mycallbackfunction( .....)
{


If ( STAE_ONOFFBUTTON == on)

{

while ( l < 2000)
{
.......... Myprocess( );
}
}


If ( STAE_ONOFFBUTOON == off)
{
stop Myprocess();
}
Return(Pt_CONTINUE);
}

My Problem when i CLICK OnOff button to ON .Before My process is finished. I can not CLICK botton again . I would like to stop My Process during loop runing . How to slove it
watcharin
New Member
 
Posts: 8
Joined: Wed Sep 10, 2003 10:20 pm

Postby cdm » Thu Oct 02, 2003 3:24 pm

Don't loop forever inside of a Photon callback? Either start a thread or use a WorkProc. You can read about both options in the Photon helpviewer book on performing long running calculations.
cdm
QNX Master
 
Posts: 789
Joined: Fri Jul 05, 2002 9:38 am


Return to GUI Programming

Who is online

Users browsing this forum: No registered users and 1 guest