#include <Fl/Fl_Window.h>
#include "inputwin.h" //<-THIS IS A CUSTOM DIALOG WITH ITS OWN WINDOW
//MAIN WINDOW CLASS
class MainAppWin : public Fl_Window
{
public:
MainAppWin(int width, int height, char* title);
~MainAppWin();
inputwin *inputdialog;
};
//CONSTRUCTOR
MainAppWin::MainAppWin(int width, int height, char* title) : Fl_Window(width,
height, title)
{
inputdialog = new inputwin(300,105,"Input Dialog");
}
//DESTRUCTOR
MainAppWin::~MainAppWin()
{
inputdialog->hide();
delete inputdialog;
}
//MAIN
int main(int argc, char** args)
{
MainAppWin *mywin= new MainAppWin(400, 400, "MainAppWin");
mywin->show();
mywin->inputdialog->show();
Fl::run();
return 0;
}
//------------------------------------------
Thanks Ian MacArthur for your explanation but I'm still unsure how to solve
this. So I posted some code.
This compiles and when I run it two windows show up on the screen.
See this image;
http://www.hyperscope.net/snapshot1.png
One window with the title "MainAppWin" and the other (which is in front) titled
"Input Dialog" (that one was created from the class in the include file input.h)
If I click on the kill button at the top of the "MainAppWin" it closes but the
window that was in front stays open, why doesn't it close also? How would I
make it work right? Thanks for helping.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk