home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / unix / emx / test / wm_hello.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-12-25  |  1.3 KB  |  30 lines

  1. /* wm_hello.c (emx+gcc) */
  2.  
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include <sys/winmgr.h>
  6.  
  7. int main (void)
  8. {
  9.   wm_handle my_first_window;                           /* Window handle      */
  10.  
  11.   if (!wm_init (10))                                   /* At most 10 windows */
  12.     goto failure;                                      /* ...failed          */
  13.   my_first_window = wm_create (20, 10, 59, 14,         /* Window corners     */
  14.                                2,                      /* Border style       */
  15.                                BW_NORMAL|INTENSITY,    /* Border attributes  */
  16.                                BW_NORMAL);             /* Default attributes */
  17.   if (my_first_window == NULL)
  18.     goto failure;                                      /* ...failed          */
  19.   wm_printf (my_first_window, "Hello world!\n");
  20.   wm_open (my_first_window);                           /* Open the window    */
  21.   sleep (2);
  22.   wm_close_all ();                                     /* Close all windows  */
  23.   wm_exit ();                                          /* End window manager */
  24.   return (0);                                          /* Done               */
  25.  
  26. failure:
  27.   fprintf (stderr, "A window manager function call failed, sorry.\n");
  28.   return (1);
  29. }
  30.