home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / n / newmarch.zip / ARROW_QU.C next >
C/C++ Source or Header  |  1992-09-08  |  2KB  |  60 lines

  1. /* Author:   $Author: jan $
  2.  * File:     $Source: /usr/usrs/jan/desktop/X_Book.boo/programs/RCS/arrow_quit.c,v $
  3.  * Date:     $Date: 1992/09/09 00:09:46 $
  4.  * Revision: $Revision: 1.1 $
  5.  */
  6.  
  7. #include "copyright.h"
  8.  
  9. #include <X11/Intrinsic.h>      
  10. #include <Xm/Xm.h>      
  11. #include <Xm/ArrowB.h>  
  12.         
  13. char Class_name[] = "Arrow";     
  14.         
  15. void quitX (w, client_d, call_d)
  16. Widget w;
  17. caddr_t client_d, call_d;
  18. {
  19.         printf ("arrow was pushed\n");
  20.         exit (0);
  21. }
  22.  
  23. main (argc, argv)       
  24. int argc;
  25. char **argv;
  26. {       
  27.         Widget toplevel, arrow_widget; 
  28.         Arg wargs[2]; /* wargs not really used here */ 
  29.                 
  30.          /* Initialize the intrinsics  with
  31.             a toplevel widget */        
  32.         toplevel = XtInitialize (NULL, /* application
  33.                                           name */
  34.                          Class_name,  /* class name */        
  35.                          NULL,          /* options */
  36.                          0,             /* number of
  37.                                            options */ 
  38.                          &argc, argv);  
  39.  
  40.         /* Create an arrow widget with the 
  41.            toplevel as manager; 
  42.         */
  43.         arrow_widget = XmCreateArrowButton (
  44.                             toplevel,   /* parent */ 
  45.                             "an_arrow", /* name */
  46.                              wargs,     /* resource
  47.                                            arguments */ 
  48.                              0);        /* number 
  49.                                            of args */
  50.         XtManageChild (arrow_widget);
  51.         XtAddCallback (arrow_widget, XmNarmCallback,
  52.                        quitX, NULL);
  53.                 
  54.         /* display all of the widgets */        
  55.         XtRealizeWidget (toplevel);     
  56.         
  57.         /* enter the main processing loop */    
  58.         XtMainLoop ();
  59. }
  60.