(I apologize for answering in English. My French is barely good enough to read, impossible to write..)
The answer depends on whether you already have a User Interface panel in your program and how you are processing events for it. There are two possibilities:
Option 1 - RunUserInterface
Using this option, your program would look something like this:
main ()
{
...
panel = LoadPanel (...);
DisplayPanel (panel);
RunUserInterface();
...
}
int done = 0;
void YourFunc (void)
{
while (!done)
{
...
// do your work here
...
}
}
int ButtonCallback (int event, ...)
{
if (event == EVENT_COMMIT)
done = 1;
return 0;
}
If you use this option, you'll have to ass
ociate ButtonCallback with your button in the UI Editor.
Option 2 - GetUserEvent
Using this option, your program would look something like this:
void YourFunc (void)
{
int done = 0;
....
panel = LoadPanel (...);
DisplayPanel (panel);
while (!done)
{
...
// do your work here
...
GetUserEvent (0, &panel, &control);
switch (control)
{
...
case PANEL_YOURBUTTON:
done = 1;
break;
...
}
}
}
I hope this makes sense. If you'd like test this, I'd suggest that you look through some of the simple example programs in samples\userint
Luis
NI