home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / demos / demobook / Working.c < prev   
Encoding:
C/C++ Source or Header  |  1994-08-02  |  5.2 KB  |  165 lines

  1. /*
  2.  * Copyright 1993, 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17.  
  18. /*******************************************************************************
  19.     Working.c
  20.  
  21. *******************************************************************************/
  22.  
  23. #include <stdio.h>
  24. #include <Xm/Xm.h>
  25. #include <Xm/DialogS.h>
  26. #include <Xm/MenuShell.h>
  27. #include "UxXt.h"
  28.  
  29. #include <Xm/MessageB.h>
  30.  
  31. /*******************************************************************************
  32.     Includes, Defines, and Global variables from the Declarations Editor:
  33. *******************************************************************************/
  34.  
  35. #include "exinterfmotif.h"
  36. #include "exglobals.h"
  37.  
  38. /*******************************************************************************
  39.     The definition of the context structure:
  40.     If you create multiple instances of your interface, the context
  41.     structure ensures that your callbacks use the variables for the
  42.     correct instance.
  43.  
  44.     For each Widget in the interface, each argument to the Interface
  45.     function, and each variable in the Instance Specific section of the
  46.     Declarations Editor, there is an entry in the context structure.
  47.     and a #define.  The #define makes the variable name refer to the
  48.     corresponding entry in the context structure.
  49. *******************************************************************************/
  50.  
  51. typedef    struct
  52. {
  53.     int    mumble;
  54. } _UxCWorking;
  55.  
  56.  
  57. static _UxCWorking    *UxWorkingContext;
  58.  
  59. Widget    Working;
  60.  
  61. /*******************************************************************************
  62.     Forward declarations of functions that are defined later in this file.
  63. *******************************************************************************/
  64.  
  65. Widget    create_Working();
  66.  
  67. /*******************************************************************************
  68.     The following are callback functions.
  69. *******************************************************************************/
  70.  
  71. static Widget    _Uxbuild_Working()
  72. {
  73.     Widget    Working_shell;
  74.  
  75.     Working_shell = XtVaCreatePopupShell( "Working_shell",
  76.             xmDialogShellWidgetClass, DBtoplevel,
  77.             XmNx, 650,
  78.             XmNy, 670,
  79.             XmNwidth, 520,
  80.             XmNheight, 380,
  81.             XmNshellUnitType, XmPIXELS,
  82.             XmNtitle, "Working",
  83.             NULL );
  84.  
  85.     Working = XtVaCreateWidget( "Working",
  86.             xmMessageBoxWidgetClass, Working_shell,
  87.             RES_CONVERT( XmNtextFontList, "-Adobe-Courier-Bold-R-Normal--14-100-100-100-M-90-ISO8859-1" ),
  88.             XmNshadowThickness, 5,
  89.             RES_CONVERT( XmNmessageString, msgstring ),
  90.             XmNmarginHeight, 12,
  91.             XmNmarginWidth, 60,
  92.             RES_CONVERT( XmNlabelFontList, "-Adobe-Helvetica-Bold-R-Normal--14-100-100-100-P-82-ISO8859-1" ),
  93.             RES_CONVERT( XmNforeground, "black" ),
  94.             RES_CONVERT( XmNdialogTitle, "Working" ),
  95.             RES_CONVERT( XmNbuttonFontList, "-Adobe-Helvetica-Bold-R-Normal--14-100-100-100-P-82-ISO8859-1" ),
  96.             RES_CONVERT( XmNbackground, "#BBBBBB" ),
  97.             XmNheight, 380,
  98.             XmNwidth, 520,
  99.             XmNunitType, XmPIXELS,
  100.             NULL );
  101.  
  102.     UxPutContext( Working, (char *) UxWorkingContext );
  103.  
  104.     XtAddCallback( Working, XmNdestroyCallback,
  105.             UxFreeClientDataCB,
  106.             (XtPointer) UxWorkingContext );
  107.  
  108.     XtRealizeWidget ( Working_shell );
  109.  
  110.     SetWMhints( Working_shell );
  111.  
  112.  
  113.     return ( Working );
  114. }
  115.  
  116. /*******************************************************************************
  117.     The following function includes the code that was entered
  118.     in the 'Initial Code' and 'Final Code' sections of the
  119.     Declarations Editor. This function is called from the
  120.     'Interface function' below.
  121. *******************************************************************************/
  122.  
  123. static Widget    _Ux_create_Working()
  124. {
  125.     Widget                 rtrn;
  126.     Arg args[10];
  127.     int n;
  128.     _UxCWorking *UxContext;
  129.  
  130.     UxWorkingContext = UxContext =
  131.         (_UxCWorking *) XtMalloc( sizeof(_UxCWorking) );
  132.  
  133.     rtrn = _Uxbuild_Working();
  134.  
  135.     XtUnmanageChild(XmMessageBoxGetChild
  136.       (Working, XmDIALOG_CANCEL_BUTTON));
  137.     XtUnmanageChild(XmMessageBoxGetChild
  138.       (Working, XmDIALOG_HELP_BUTTON));
  139.     XtUnmanageChild(XmMessageBoxGetChild
  140.       (Working, XmDIALOG_OK_BUTTON));
  141.  
  142.     return(rtrn);
  143. }
  144.  
  145. /*******************************************************************************
  146.     The following is the 'Interface function' which is the
  147.     external entry point for creating this interface.
  148.     This function should be called from your application or from
  149.     a callback function.
  150. *******************************************************************************/
  151.  
  152. Widget    create_Working()
  153. {
  154.     Widget            _Uxrtrn;
  155.  
  156.     _Uxrtrn = _Ux_create_Working();
  157.  
  158.     return ( _Uxrtrn );
  159. }
  160.  
  161. /*******************************************************************************
  162.     END OF FILE
  163. *******************************************************************************/
  164.  
  165.