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.Create.c
- Author: Copyright © 1992 Jason Williams
- Version: 1.00 (19 Mar 1992)
- Purpose: High-level window management functions: Create 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"
-
-
- #define ERRBASE 1
- #define ERR1 ERRBASE+0
- #define ERRMESS1 "Insufficient memory to open window"
-
-
- linklist_header window_listanchor;
-
-
- extern window_handle Window_Create(char *windowname, int maxtitlesize)
- {
- windowrec *record;
- window_block *windowptr;
- window_handle window;
-
- windowptr = Template_Clone(windowname, maxtitlesize);
- Wimp_CreateWindow(windowptr, &window);
-
- record = (windowrec *) malloc(sizeof(windowrec));
- if (record == NULL) Error_ReportFatalInternal(ERR1, ERRMESS1);
-
- LinkList_AddToHead(&window_listanchor, &(record->header));
-
- strncpy(record->templatename, windowname, wimp_MAXNAME);
- record->templatename[wimp_MAXNAME] = 0; /* Record of name for help */
-
- record->window = window; /* Remember window handle */
- record->memory = windowptr; /* remember to dealloc later */
-
- return(window);
- }
-
-