home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / OS2 / EMXFIX04.ZIP / WMDELETE.C < prev    next >
C/C++ Source or Header  |  1994-01-16  |  528b  |  29 lines

  1. /* wmdelete.c (emx+gcc) -- Copyright (c) 1987-1994 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.   _tfree (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.