> The problem is, FL::check allows FLTK to respond to additional events. So
> if the user tries to click the button again, the function will presumably
> start over. (I don't know how FLTK handles this--does it create a new thread?
> Does it just "cancel" what was happening before?)
It calls the function: Like
Fl::run() would call button_cb, which would call Fl::check() which
would call button_cb
>
> When the user clicks the button one or more times while the function is
> already running, I can get segmentation faults / assertion failures due to
> statements in the function, because the previous call did not properly
> terminate and clean things up.
>
> Ideally, I'd like the button to ignore subsequent clicks while the function
> is still being computed.
>
> Any ideas how I might accomplish this?
static int running;
if (running = 1) return;
running = 1;
while (cond) {
do_something();
Fl::check();
}
running = 0;
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk