home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / EMXLIB8F.ZIP / EMX / LIB / VIDEO / WMDELETE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-02  |  526 b   |  29 lines

  1. /* wmdelete.c (emx+gcc) -- Copyright (c) 1987-1993 by Eberhard Mattes */
  2.  
  3. #include <stdlib.h>
  4. #include <sys/winmgr.h>
  5. #include "winmgr2.h"
  6.  
  7.  
  8. void wm_delete (wm_handle wh)
  9. {
  10.   int i, idx;
  11.  
  12.   if (wh->used != WM_USED)
  13.     return;
  14.   idx = _wm_idx1 (wh);
  15.   if (idx < 0)
  16.     return;
  17.   --_wm_count;
  18.   for (i = idx; i < _wm_count; ++i)
  19.     _wm_idx[i] = _wm_idx[i+1];
  20.   free (wh->data);
  21.   free (wh->mask);
  22.   wh->used = 0;
  23.   if (_wm_cursor == wh)
  24.     {
  25.       _wm_cursor = NULL;
  26.       _wm_cursor1 ();
  27.     }
  28. }
  29.