mainWinCallback.cc

/**
   @file      mainWinCallback.cc
   @author    Mitch Richling <http://www.mitchr.me/>
   @Copyright Copyright 2003 by Mitch Richling.  All rights reserved.
   @brief     How to assign the main window callback.   @EOL
   @Keywords  fltk window
   @Std       C++98

              The main window callback is invoked when the close
              button is hit.  This program illustrates how to
              bind this callback to a function that will quit 
              the application -- this is actually the default
              behavior.  Use this callback to take care of things
              before an application is closed!
              
*/

#include <FL/Fl.h>              /* FLTK main       FLTK  */
#include <FL/Fl_Window.h>       /* FLTK window     FLTK  */

#include <stdio.h>              /* I/O lib         ISOC  */
#include <stdlib.h>             /* Standard Lib    ISOC  */

void daWinCall(Fl_Widget *w, void *uData) {
  printf("The window callback was called.\n");
  exit(0);
}

int main() {
  Fl_Window win(500, 500, "Main Window Callback Example Program");
  win.callback(daWinCall);
  win.show();
  return Fl::run();
}


Generated by GNU Enscript 1.6.5.2.