My callback takes a long time. My callback grabs many images then
pastes those images onto multiple widgets. I want to show the widgets
during the callback as each image is set, not all at once at the end.
I wrote a similar example to illustrate my problem below. How can I
reveal the input BEFORE the 2 sec sleep?
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Input.H>
#include <cstdlib>
using namespace std;
void copy_cb( Fl_Widget* o , void* v) {
Fl_Input* i=(Fl_Input*)v;
i->show();
i->parent()->redraw(); //doesn't work
system("sleep 2s");
}
int main() {
Fl_Window* win= new Fl_Window(300,200, "Testing");
win->begin();
Fl_Button* copy = new Fl_Button( 50, 100, 140, 30);
Fl_Input* inp = new Fl_Input(50, 50, 140, 30);
win->end();
inp->hide();
copy->callback( copy_cb, inp );//inp is userdata
win->show();
return Fl::run();
}
--
Robert Arkiletian
Eric Hamber Secondary, Vancouver, Canada
Fl_TeacherTool http://www3.telus.net/public/robark/Fl_TeacherTool/
C++ GUI tutorial http://www3.telus.net/public/robark/
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk