>So when I now, as you counciled, declare all the Windows globally such as >Fl_Window w1(5,198,600,275,"Tester"); This is why we want to see a program, not "snippets" with text. We will "guess" what you're doing and be at odds ...
I interpreted what you did differently from Greg. I think you did:
File1:
Fl_Window w1(5,198,600,275,"Tester"); // note: declared and created globally main() { w1.show() }
File2: extern Fl_Window w1;
some_func() { w1.hide() }
To me, the issue I think I'm seeing is you are trying to use "objects" and not pointers. I think the error you are getting at program shutdown is FLTK trying to destroy the FL_Window instances you created globally, and that can't be done. FLTK is a C library, not a C++ library, so it's best if you work with pointers.
The approach I would use is:
File1: Fl_Window *w1; main() { w1 = new Fl_Window(5, 198, 600, 275, "Tester"); // note: declared globally, allocated ON THE HEAP w1->hide(); // pointer syntax }
File2: extern Fl_Window *w1; // extern pointer
some_func() { w1->hide(); // pointer syntax }
Kevin
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/ca5666eb-c141-4048-8742-9b91d3e137fcn%40googlegroups.com.
[ Direct Link to Message ] |