mirror of https://github.com/fltk/fltk
Fixed adding an idle handler during a draw() call (STR #1950)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@6474 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
e9e4aaec46
commit
c0a8bd653d
2
CHANGES
2
CHANGES
|
@ -9,6 +9,8 @@ CHANGES IN FLTK 1.1.10
|
|||
function (STR #1945)
|
||||
- Fl_Group and Fl_Scroll now resize themselves before
|
||||
resizing their children (STR #2032)
|
||||
- Fixed adding an idle handler during
|
||||
a draw() call (STR #1950)
|
||||
|
||||
CHANGES IN FLTK 1.1.9
|
||||
|
||||
|
|
|
@ -323,6 +323,8 @@ double Fl::wait(double time_to_wait) {
|
|||
if (idle) time_to_wait = 0.0;
|
||||
}
|
||||
flush();
|
||||
if (idle && !in_idle) // 'idle' may have been set within flush()
|
||||
time_to_wait = 0.0;
|
||||
return fl_wait(time_to_wait);
|
||||
|
||||
#else
|
||||
|
@ -369,6 +371,8 @@ double Fl::wait(double time_to_wait) {
|
|||
} else {
|
||||
// do flush first so that user sees the display:
|
||||
flush();
|
||||
if (idle && !in_idle) // 'idle' may have been set within flush()
|
||||
time_to_wait = 0.0;
|
||||
return fl_wait(time_to_wait);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -33,12 +33,12 @@
|
|||
Drawing_Window mbrot;
|
||||
Drawing_Window jbrot;
|
||||
|
||||
void idle() {
|
||||
if (!mbrot.d->idle() && !(jbrot.d && jbrot.d->idle())) Fl::set_idle(0);
|
||||
void idle(void*) {
|
||||
if (!mbrot.d->idle() && !(jbrot.d && jbrot.d->idle())) Fl::remove_idle(idle);
|
||||
}
|
||||
|
||||
void set_idle() {
|
||||
Fl::set_idle(idle);
|
||||
Fl::add_idle(idle);
|
||||
}
|
||||
|
||||
static void window_callback(Fl_Widget*, void*) {exit(0);}
|
||||
|
|
Loading…
Reference in New Issue