home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 24 / AACD 24.iso / AACD / System / ReqToolsLib / Source / reqtools / rtclosewindowsafely.c < prev    next >
Encoding:
C/C++ Source or Header  |  2001-07-02  |  2.0 KB  |  87 lines

  1.  
  2. /*
  3.     (C) 1999 AROS - The Amiga Research OS
  4.     $Id: rtclosewindowsafely.c,v 1.5 2000/12/15 20:43:35 stegerg Exp $
  5.  
  6.     Desc:
  7.     Lang: English
  8. */
  9.  
  10. #include <exec/types.h>
  11. #include <proto/exec.h>
  12. #include <proto/reqtools.h>
  13. #include <proto/intuition.h>
  14. #include <exec/libraries.h>
  15. #include <exec/memory.h>
  16. #include <aros/libcall.h>
  17. #include "general.h"
  18. #include "reqtools_intern.h"
  19. #include "rtfuncs.h"
  20.  
  21. /*****************************************************************************
  22.  
  23.     NAME */
  24.  
  25.     AROS_LH1(VOID, rtCloseWindowSafely,
  26.  
  27. /*  SYNOPSIS */
  28.  
  29.     AROS_LHA(struct Window *, window, A0),
  30.  
  31. /*  LOCATION */
  32.  
  33.     struct ReqToolsBase *, ReqToolsBase, 25, ReqTools)
  34.  
  35. /*  FUNCTION
  36.  
  37.     Closes a window which shares its IDCMP port with another window.  All the
  38.     pending messages (concerning this window) on the port will be removed and
  39.     the window will be closed.
  40.  
  41.     Do not use this function to close windows which have an IDCMP port set up
  42.     by Intuition.  If you do the port will be left in memory!
  43.  
  44.     If you intend to open a lot of windows all sharing the same IDCMP port it
  45.     is easiest if you create a port yourself and open all windows with
  46.     newwin.IDCMPFlags set to 0 (this tells Intuition to NOT set up an IDCMP
  47.     port).  After opening the window set the win->UserPort to your message
  48.     port and call ModifyIDCMP to set your IDCMP flags.
  49.  
  50.     When you then receive messages from intuition check the imsg->IDCMPWindow
  51.     field to find out what window they came from and act upon them.
  52.  
  53.     When closing your windows call rtCloseWindowSafely() for all of them and
  54.     delete your message port.
  55.  
  56.     INPUTS
  57.  
  58.     window  --  pointer to the window to be closed
  59.  
  60.     RESULT
  61.  
  62.     NOTES
  63.  
  64.     This function is for the advanced ReqTools user.
  65.  
  66.     EXAMPLE
  67.  
  68.     BUGS
  69.     none known
  70.  
  71.     SEE ALSO
  72.     intuition.library/CloseWindow()
  73.  
  74.     INTERNALS
  75.  
  76.     HISTORY
  77.  
  78. ******************************************************************************/
  79. {
  80.     AROS_LIBFUNC_INIT
  81.  
  82.     RTFuncs_CloseWindowSafely(window);
  83.     
  84.     AROS_LIBFUNC_EXIT
  85.     
  86. } /* rtCloseWindowSafely*/
  87.