home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / gkdemo.zip / GKFILES.SET / EMPLAPPL.C < prev    next >
C/C++ Source or Header  |  1994-12-09  |  2KB  |  70 lines

  1. /*----------------------------------------------------------------------
  2.  * Employee Maintenance Example
  3.  */
  4.  
  5. #define GKInclAll
  6. #include "gk.h"
  7.  
  8. static void    OKButtonNotify(GKObject obj);
  9. static void    CancelButtonNotify(GKObject obj);
  10. static void    SearchButtonNotify(GKObject obj);
  11. static void    HelpButtonNotify(GKObject obj);
  12.  
  13. /*----------------------------------------------------------------------*/
  14. int main(int argc, char **argv)
  15. {
  16.     gkRegisterNamedProcedure("OKButtonNotify",
  17.                              (GKNamedProcedure)OKButtonNotify);
  18.     gkRegisterNamedProcedure("CancelButtonNotify",
  19.                              (GKNamedProcedure)CancelButtonNotify);
  20.     gkRegisterNamedProcedure("SearchButtonNotify",
  21.                              (GKNamedProcedure)SearchButtonNotify);
  22.     gkRegisterNamedProcedure("HelpButtonNotify",
  23.                              (GKNamedProcedure)HelpButtonNotify);
  24.  
  25.     gkInit(GKInit_Args, &argc, argv,
  26.            GKInit_StripArgs,
  27.            NULL);
  28.  
  29.     if (gkCreateObjectGroup("EmplGroup") == -1) {
  30.         gkError("Couldn't create EmplGroup object group");
  31.         exit(1);
  32.     }
  33.  
  34.     gkDispatch();
  35.     return(0);
  36. }
  37.  
  38. /*----------------------------------------------------------------------*/
  39. /* NotifyProc for OK button.
  40.  */
  41. static void    OKButtonNotify(GKObject obj)
  42. {
  43.     gkInfo("Employee Information Updated.");
  44. }
  45.  
  46. /*----------------------------------------------------------------------*/
  47. /* NotifyProc for Cancel button. Exit application.
  48.  */
  49. static void    CancelButtonNotify(GKObject obj)
  50. {
  51.     gkDestroyObjectGroup("EmplGroup");
  52. }
  53.  
  54. /*----------------------------------------------------------------------*/
  55. /* NotifyProc for Search button.
  56.  */
  57. static void    SearchButtonNotify(GKObject obj)
  58. {
  59.     gkInfo("Search function not implemented.");
  60. }
  61.  
  62. /*----------------------------------------------------------------------*/
  63. /* NotifyProc for Help button. Bring up some help.
  64.  */
  65. static void    HelpButtonNotify(GKObject obj)
  66. {
  67.     gkShowHelp(gkFindInstance("EmplFrame"), "emplappl.hlp", NULL);
  68. }
  69.  
  70.