I have a program that displays an input window and is then supposed to close the input window and open another window using the data from the input window. The problem I am facing is that clicking the submit button on the input window terminates the program.
int main() {
int month;
int year;
String file_name;
cin>>file_name;
Input_window win(Point(100,200),600,300,"Calendar");
win.show();
Calendar win1(Point(100,100),750,800,"Canvas",year,month,file_name);
return gui_main();
}
I've looked thorugh Stroustrup's Principle and Practice Using C++ and through the documentation for FLTK but I have been unable to find a solution.
Here is the code for the button click:
void Input_window::cb_quit(Address,Address pw)
{
reference_to<Input_window>(pw).save_input();
}
void Input_window::save_input()
{
month = box_month.get_int();
year = box_year.get_int();
redraw();
}