I was trying to create a small program that would have no onscreen GUI but that 
would utilize Fl_Offscreen but it immediately cored. The following is enough to 
create a core:

main() { Fl_Offscreen x=fl_create_offscreen(640,480); }

Works fine in a callback fired by Fl::run() after constructing a window.

After a little investigation it appears that the add_timeout example from the 
docs doesnt work either:

The following does not work:

void callback(void*) {
  printf("TICK\n");
  Fl::repeat_timeout(1.0,callback);
}

main() {
  Fl::add_timeout(1.0,callback);
  for (;;) Fl::wait();
}

however the following does:

void callback(void*) {
  printf("TICK\n");
  Fl::repeat_timeout(1.0,callback);
}

main() {
  Fl_Window *win=new Fl_Window(640,480,"xxx");
  win->show();
  Fl::add_timeout(1.0,callback);
  for (;;) Fl::wait();
}

Shortening the timeout causes a segv:

void callback(void*) {
  printf("TICK\n");
  Fl::repeat_timeout(1.0,callback);
}

main() {
  Fl_Window *win=new Fl_Window(640,480,"xxx");
  win->show();
  Fl::add_timeout(0.01,callback);
  for (;;) Fl::wait();
}

I assume that fltk needs to have established a connection to the GUI before 
things work correctly. Not a biggie for me but it would be nice to use 
Fl_Offscreen to draw things without X (or Xvfb fudging).

Using fltk 1.1.9 on 64bit Linux RHAS4.

Regards

PG


_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to