diff --git a/fluid/fluid.cxx b/fluid/fluid.cxx index 02b9b0185..c43f7fcca 100644 --- a/fluid/fluid.cxx +++ b/fluid/fluid.cxx @@ -1,5 +1,5 @@ // -// "$Id: fluid.cxx,v 1.15 1999/03/09 06:59:05 bill Exp $" +// "$Id: fluid.cxx,v 1.15.2.1 1999/04/18 23:43:42 mike Exp $" // // FLUID main entry for the Fast Light Tool Kit (FLTK). // @@ -110,10 +110,6 @@ void leave_source_dir() { Fl_Window *main_window; -void exit_cb(Fl_Widget *,void *) { - if (!modflag || fl_ask("Exit without saving changes?")) exit(0); -} - void save_cb(Fl_Widget *, void *v) { const char *c = filename; if (v || !c || !*c) { @@ -127,6 +123,20 @@ void save_cb(Fl_Widget *, void *v) { modflag = 0; } +void exit_cb(Fl_Widget *,void *) { + if (modflag) + switch (fl_choice("Save changes before exiting?", "Cancel", "No", "Yes")) + { + case 0 : /* Cancel */ + return; + case 2 : /* Yes */ + save_cb(NULL, NULL); + if (modflag) return; // Didn't save! + } + + exit(0); +} + void open_cb(Fl_Widget *, void *v) { if (!v && modflag && !fl_ask("Discard changes?")) return; const char *c; @@ -418,5 +428,5 @@ int main(int argc,char **argv) { } // -// End of "$Id: fluid.cxx,v 1.15 1999/03/09 06:59:05 bill Exp $". +// End of "$Id: fluid.cxx,v 1.15.2.1 1999/04/18 23:43:42 mike Exp $". //