FLTK: Closing a window after a certain amount of time

I am making a splash screen for a program I'm involved in and I am currently stuck on finding a way for the window to close after a few seconds. I've tried using sleep to delay the hiding of a window. Though it only delays the closing of the window only when the standard windows close button is pressed. Any other way of approaching this problem?

1
2
3
4
5
6
7
8
  	Fl_Window s_win(300,250,600,330,"Welcome");
	Fl_Box box(0,0,600,330);     // widget that will contain image
        Fl_JPEG_Image jpg("Splash.jpg");      // load splashscreen image
        box.image(jpg);
	s_win.show();
	Fl::run();
	sleep(3);
        s_win.hide();
Last edited on
Topic archived. No new replies allowed.