If your code is included in a while loop, you must add some statements to let the system update the user interface.
If the problem is limited to updating some panel controls, you can simply add a ProcessDrawEvents () statement somewhere in your loop to let the control updates show.
In case you need to respond to some event while in the loop (e.g. some button press or else) you need to use ProcessSystemEvents () instead: this function updates the user interface and processes all events pending from when it was executed last time. It is a good practice to add this in long lasting loops to let the system process all the events.
Your code should look this way:
while (TRUE) {
// Your code here
ProcessSystemEvents (); //Let the system process
events
GetCtrlVal (panel, PANEL_STOP, &stop); // Test the stop button
if (stop) break;
// Test value of buttons, retrieve values of modified controls...
}
Another way of testing a stop button could be to create a specific callback for the button: inside the callback update a global variable and use this variable as a breaking condition for the test loop.
Hope this helps
Roberto