home *** CD-ROM | disk | FTP | other *** search
- /*
- #### # # # #
- # # # # # The FreeWare C library for
- # # ## ### # # # # ### RISC OS machines
- # # # # # # # # # # # ___________________________________
- # # #### ### ## # # # #
- # # # # # # # # # # Please refer to the accompanying
- #### ### #### # # ##### # ### documentation for conditions of use
- ________________________________________________________________________
-
- File: Window.Delete.c
- Author: Copyright © 1992 Jason Williams
- Version: 1.00 (19 Mar 1992)
- Purpose: High-level window management functions: Show/hide a window
- */
-
-
- #include "LinkList.h"
- #include "WimpSWIs.h"
- #include "Template.h"
- #include "Event.h"
- #include "Window.h"
- #include "Screen.h"
- #include "Error.h"
-
- #include "WindowDefs.h"
-
- #include <stdlib.h>
- #include "string.h"
-
-
- extern linklist_header window_listanchor;
-
-
-
- extern void Window_Delete(window_handle window)
- {
- windowrec *ptr;
-
- Event_ReleaseWindow(window); /* Release all handlers for this window */
-
- Wimp_CloseWindow(window); /* say bye bye! */
- Wimp_DeleteWindow(window);
-
- ptr = (windowrec *) window_listanchor.next;
- while (ptr != NULL)
- {
- if (ptr->window == window)
- break;
- ptr = (windowrec *) ptr->header.next;
- }
-
- if (ptr == NULL)
- return; /* Window not created with Window_Show(). Bad user! */
-
- LinkList_Unlink(&window_listanchor, &(ptr->header));
-
- Template_Free(&(ptr->memory)); /* Free up the window's indirected data */
- free(ptr); /* ... and the window's list entry */
- }
-