> Maybe I will show an example and someone can point me to my wrong doing:
> I was trying to avoid creating all windows at once and reuse them like FLTK
> expects you to do (?).
> This would cause too much strain on my memory resources and I only need one
> popup window at a time.
How about decoupling the window and its contents?
You'd just keep 1 "shell" of a window lying around, and
the framework would stop growing.
class Popup {
static Fl_Window* win;
public:
Popup(..) { if(!win) win = new Fl_Window(..); create(); }
~Popup() { destroy(); }
protected:
virtual void create() = 0;
virtual void destroy() = 0;
void add(Fl_Widget* w) { win->add(w); }
void remove(Fl_Widget* w) { win->remove(*w); }
// probably some more forwarding methods
};
class About_Dialog : public Popup {
public:
About_Dialog(...) : Popup(...) { // maybe resize win or whatever }
void create { out = new Fl_Output(..); add(out); // etc }
void destroy { remove(out); delete(out); // etc }
private:
Fl_Output* out;
// etc
};
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk