> However, there is no
> need to delete objects that are used until the program exits - this
> will be done by the OS anyway
There is no need to create objects dynamically, so using objects
directly makes code shorter and prevents doubts of deleting:
#include<Fl/Fl_Window.h>
#include "inputwin.h"
class MainAppWin : public Fl_Window
{
public:
MainAppWin::MainAppWin(int width, int height, char* title) :
Fl_Window(width, height, title),
inputdialog(300,105,"Input Dialog")
{
end();
}
virtual ~MainAppWin() {}
inputwin inputdialog; // direct definition of object!
};
int main(int argc, char** args)
{
MainAppWin mywin(400, 400, "MainAppWin");
mywin.show();
mywin.inputdialog.show();
Fl::run();
return 0;
}
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk