home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d9xx / d911 / psm.lha / PSM / Source / source.lha / examine.c < prev    next >
C/C++ Source or Header  |  1993-07-28  |  16KB  |  492 lines

  1.  
  2. #include "psm.h"
  3.  
  4. /**
  5.  ** Definition of examine window
  6.  **/
  7.  
  8. enum {
  9.     
  10.     WINTAGS_ID = 1,
  11.     
  12.     TITLE_ID,
  13.     PUBNAME_ID,
  14.  
  15.     WINLIST_ID,
  16.     LEFT_ID,
  17.     TOP_ID,
  18.     WIDTH_ID,
  19.     HEIGHT_ID,
  20.     
  21.     TYPE_ID,
  22.     AUTOSCROLL_ID,
  23.     FONTNAME_ID,
  24.     FONTSIZE_ID,
  25. };
  26.  
  27. static ULONG __saveds __interrupt
  28. examine_handler(struct GadOutline *go, ULONG command, struct GOIMsg *msg);
  29.  
  30. static ULONG examine_outline[] = {
  31.  
  32. GO_OUTLINETAGS(0,0),
  33.     TAG_END,
  34.     GOA_BaseName,           (ULONG)&__BaseName[0],
  35.     GOA_SetUserHandler,     (ULONG)&examine_handler,
  36.     GOA_SetTransHookData,   NULL,
  37.     GOA_ClearFullWin,       TRUE,
  38.     GOA_ErrorReportLevel,     
  39.           (1L<<GOTYPE_FINE)  | (1L<<GOTYPE_FINE2)
  40.         | (1L<<GOTYPE_NOTE)  | (1L<<GOTYPE_NOTE2)
  41.         | (1L<<GOTYPE_WARN)  | (1L<<GOTYPE_WARN2)
  42.         | (1L<<GOTYPE_ALERT) | (1L<<GOTYPE_ALERT2) | (1L<<GOTYPE_ALERT3)
  43.         | (1L<<GOTYPE_FAIL)  | (1L<<GOTYPE_FAIL2)  | (1L<<GOTYPE_FAIL3),
  44.     TAG_END,
  45.  
  46. GO_WINDOWTAGS(0,WINTAGS_ID),
  47.     TAG_END,
  48.     WA_Title,           (ULONG)&"Examine Screen", //(ULONG)&__ShortTitle[0],
  49.     WA_ScreenTitle,     (ULONG)&__LongTitle[0],
  50.     WA_IDCMP,           IDCMP_CLOSEWINDOW | IDCMP_REFRESHWINDOW,
  51.     WA_Activate,        TRUE,
  52.     WA_CloseGadget,     TRUE,
  53.     WA_DepthGadget,     TRUE,
  54.     WA_DragBar,         TRUE,
  55.     WA_SizeGadget,      TRUE,
  56.     WA_SizeBBottom,     TRUE,
  57.     WA_SimpleRefresh,   TRUE,
  58.     WA_BackFill,        NULL,
  59.     TAG_END,
  60.  
  61. GO_COMMANDTAGS(0,0),
  62.     TAG_END,
  63.     GOCT_SetHotKey, 0,
  64.     TAG_END,
  65.  
  66. GO_VDRAWGRP(0,0,1),
  67. GOCT_SizeSpaceAbove, GO_TSIZE(GOM_PadSet,80,GOT_PercCharH),
  68. GOCT_SizeSpaceBelow, GO_TSIZE(GOM_PadSet,80,GOT_PercCharH),
  69. GOCT_SizeSpaceLeft, GO_TSIZE(GOM_PadSet,80,GOT_PercCharW),
  70. GOCT_SizeSpaceRight, GO_TSIZE(GOM_PadSet,80,GOT_PercCharW),
  71. TAG_END,
  72. GODT_DrawStdFrame, GO_SCLPNT(SHADOWPEN,0,0,63,63),
  73. TAG_END,
  74.  
  75.     GO_VDRAWGRP(0,0,0),
  76.     GOCT_SizeSpaceAbove, GO_TSIZE(GOM_PadSet,50,GOT_PercCharH),
  77.     GOCT_SizeSpaceBelow, GO_TSIZE(GOM_PadSet,50,GOT_PercCharH),
  78.     GOCT_SizeSpaceLeft, GO_TSIZE(GOM_PadSet,50,GOT_PercCharW),
  79.     GOCT_SizeSpaceRight, GO_TSIZE(GOM_PadSet,50,GOT_PercCharW),
  80.     TAG_END,
  81.     GODT_DrawStdFrame, GO_SCLPNT(SHADOWPEN,0,0,63,63),
  82.     TAG_END,
  83.  
  84.         /**
  85.         GO_DRAWBOX(0,DEFTITLE_ID,1),
  86.         GOCT_TextPtrTag, GODT_DrawHighText,
  87.         GOCT_SizeBodyWidth, GO_TSIZE(GOM_StdSet,100,GOT_PercTextMaxW),
  88.         GOCT_SizeBodyHeight, GO_TSIZE(GOM_StdSet,100,GOT_PercTextMaxH),
  89.         GOCT_SizeBodyWidth, GO_TSIZE(GOM_StdAdd,500,GOT_PercCharW),
  90.         TAG_END,
  91.         GODT_BodyTextPtr, (ULONG)&"",
  92.         GODT_SetTextMode, TXTMD_LEFT | TXTMD_ENDRIGHT | TXTMD_RELTOP,
  93.         GODT_MoveTo, GO_SCLPNT(0,0,0,0,0),
  94.         GODT_DrawHighText, (ULONG)&"Name: ",
  95.         GODT_DrawStdTextTag, GODT_BodyTextPtr,
  96.         TAG_END,
  97.         **/
  98.             
  99.         GO_DRAWBOX(GOSD_Normal,0,PUBNAME_ID,1),
  100.         GOCT_TextPtrTag, GODT_DrawHighText,
  101.         GOCT_SizeBodyWidth, GO_TSIZE(GOM_StdSet,100,GOT_PercTextMaxW),
  102.         GOCT_SizeBodyHeight, GO_TSIZE(GOM_StdSet,100,GOT_PercTextMaxH),
  103.         GOCT_SizeBodyWidth, GO_TSIZE(GOM_StdAdd,500,GOT_PercCharW),
  104.         TAG_END,
  105.         GODT_BodyTextPtr, (ULONG)&"",
  106.         GODT_SetTextMode, FLGALL(TXTMD_LEFT | TXTMD_ENDRIGHT | TXTMD_RELTOP),
  107.         GODT_MoveTo, GO_SCLPNT(0,0,0,0,0),
  108.         GODT_DrawHighText, (ULONG)&"Public Name: ",
  109.         GODT_DrawStdTextTag, GODT_BodyTextPtr,
  110.         TAG_END,
  111.             
  112.         GO_DRAWBOX(GOSD_Normal,0,TITLE_ID,1),
  113.         GOCT_TextPtrTag, GODT_DrawHighText,
  114.         GOCT_SizeBodyWidth, GO_TSIZE(GOM_StdSet,100,GOT_PercTextMaxW),
  115.         GOCT_SizeBodyHeight, GO_TSIZE(GOM_StdSet,100,GOT_PercTextMaxH),
  116.         GOCT_SizeBodyWidth, GO_TSIZE(GOM_StdAdd,500,GOT_PercCharW),
  117.         TAG_END,
  118.         GODT_BodyTextPtr, (ULONG)&"",
  119.         GODT_SetTextMode, FLGALL(TXTMD_LEFT | TXTMD_ENDRIGHT | TXTMD_RELTOP),
  120.         GODT_MoveTo, GO_SCLPNT(0,0,0,0,0),
  121.         GODT_DrawHighText, (ULONG)&"Title: ",
  122.         GODT_DrawStdTextTag, GODT_BodyTextPtr,
  123.         TAG_END,
  124.         
  125.     GO_ENDGRP(),
  126.  
  127.     //GO_EMPTYBOX(0,0,0), TAG_END,
  128.  
  129.     GO_GTBOX(LISTVIEW_KIND, 0, WINLIST_ID, 1,
  130.         (ULONG)&"Windows", PLACETEXT_ABOVE|NG_HIGHLABEL),
  131.     GOCT_SizeBodyHeight, GO_TSIZE(GOM_StdMax,500,GOT_PercCharH),
  132.     GOCT_SizeUser1, GO_TSIZE(GOM_VarSet,200,GOT_PercCharW),
  133.     GOCT_CopyUser1ToTag, GTLV_ScrollWidth,
  134.     TAG_END,
  135.     GTLV_ReadOnly, TRUE,
  136.     GTLV_Labels, NULL,
  137.     GTLV_ScrollWidth, 16,
  138.     GT_Underscore, '_',
  139.     GA_Disabled, FALSE,
  140.     TAG_END,
  141.  
  142.     GO_VDRAWGRP(0,0,0),
  143.     GOCT_FitToGroup, TRUE,
  144.     GOCT_SizeSpaceAbove, GO_TSIZE(GOM_PadSet,50,GOT_PercCharH),
  145.     GOCT_SizeSpaceBelow, GO_TSIZE(GOM_PadSet,50,GOT_PercCharH),
  146.     GOCT_SizeSpaceLeft, GO_TSIZE(GOM_PadSet,50,GOT_PercCharW),
  147.     GOCT_SizeSpaceRight, GO_TSIZE(GOM_PadSet,50,GOT_PercCharW),
  148.     TAG_END,
  149.     GODT_DrawStdFrame, GO_SCLPNT(SHADOWPEN,0,0,63,63),
  150.     TAG_END,
  151.         
  152.         GO_HORIZGRP(0,0,1), TAG_END,
  153.         
  154.             GO_VERTGRP(0,0,1), TAG_END,
  155.             
  156.                 GO_GTBOX(NUMBER_KIND, 0, LEFT_ID, 1,
  157.                     (ULONG)&"Left: ", PLACETEXT_LEFT|NG_HIGHLABEL),
  158.                 GOCT_SizeBodyWidth, GO_TSIZE(GOM_StdSet,400,GOT_PercChar0),
  159.                 GOCT_SizeBodyHeight, GO_TSIZE(GOM_StdSet,100,GOT_PercCharH),
  160.                 GOCT_SizeBodyWidth, GO_TSIZE(GOM_PadSet,0,GOT_Pixels),
  161.                 GOCT_SizeBodyHeight, GO_TSIZE(GOM_PadSet,0,GOT_Pixels),
  162.                 TAG_END,
  163.                 GTNM_Number, 0,
  164.                 GA_Disabled, FALSE,
  165.                 TAG_END,
  166.  
  167.                 GO_GTBOX(NUMBER_KIND, 0, TOP_ID, 1,
  168.                     (ULONG)&"Top: ", PLACETEXT_LEFT|NG_HIGHLABEL),
  169.                 GOCT_SizeBodyWidth, GO_TSIZE(GOM_StdSet,400,GOT_PercChar0),
  170.                 GOCT_SizeBodyHeight, GO_TSIZE(GOM_StdSet,100,GOT_PercCharH),
  171.                 GOCT_SizeBodyWidth, GO_TSIZE(GOM_PadSet,0,GOT_Pixels),
  172.                 GOCT_SizeBodyHeight, GO_TSIZE(GOM_PadSet,0,GOT_Pixels),
  173.                 TAG_END,
  174.                 GTNM_Number, 0,
  175.                 GA_Disabled, FALSE,
  176.                 TAG_END,
  177.                 
  178.             GO_ENDGRP(),
  179.  
  180.             GO_VERTGRP(0,0,1), TAG_END,
  181.         
  182.                 GO_GTBOX(NUMBER_KIND, 0, WIDTH_ID, 1,
  183.                     (ULONG)&"Width: ", PLACETEXT_LEFT|NG_HIGHLABEL),
  184.                 GOCT_SizeBodyWidth, GO_TSIZE(GOM_StdSet,400,GOT_PercChar0),
  185.                 GOCT_SizeBodyHeight, GO_TSIZE(GOM_StdSet,100,GOT_PercCharH),
  186.                 GOCT_SizeBodyWidth, GO_TSIZE(GOM_PadSet,0,GOT_Pixels),
  187.                 GOCT_SizeBodyHeight, GO_TSIZE(GOM_PadSet,0,GOT_Pixels),
  188.                 TAG_END,
  189.                 GTNM_Number, 0,
  190.                 GA_Disabled, FALSE,
  191.                 TAG_END,
  192.  
  193.                 GO_GTBOX(NUMBER_KIND, 0, HEIGHT_ID, 1,
  194.                     (ULONG)&"Height: ", PLACETEXT_LEFT|NG_HIGHLABEL),
  195.                 GOCT_SizeBodyWidth, GO_TSIZE(GOM_StdSet,400,GOT_PercChar0),
  196.                 GOCT_SizeBodyHeight, GO_TSIZE(GOM_StdSet,100,GOT_PercCharH),
  197.                 GOCT_SizeBodyWidth, GO_TSIZE(GOM_PadSet,0,GOT_Pixels),
  198.                 GOCT_SizeBodyHeight, GO_TSIZE(GOM_PadSet,0,GOT_Pixels),
  199.                 TAG_END,
  200.                 GTNM_Number, 0,
  201.                 GA_Disabled, FALSE,
  202.                 TAG_END,
  203.             
  204.             GO_ENDGRP(),
  205.             
  206.         GO_ENDGRP(),
  207.  
  208.     GO_ENDGRP(),
  209.     
  210.     GO_EMPTYBOX(0,0,0), TAG_END,
  211.  
  212.     GO_VDRAWGRP(0,0,0),
  213.     GOCT_SizeSpaceAbove, GO_TSIZE(GOM_PadSet,50,GOT_PercCharH),
  214.     GOCT_SizeSpaceBelow, GO_TSIZE(GOM_PadSet,50,GOT_PercCharH),
  215.     GOCT_SizeSpaceLeft, GO_TSIZE(GOM_PadSet,50,GOT_PercCharW),
  216.     GOCT_SizeSpaceRight, GO_TSIZE(GOM_PadSet,50,GOT_PercCharW),
  217.     TAG_END,
  218.     GODT_DrawStdFrame, GO_SCLPNT(SHADOWPEN,0,0,63,63),
  219.     TAG_END,
  220.  
  221.         GO_HORIZGRP(0,0,1), TAG_END,
  222.         
  223.             GO_DRAWBOX(GOSD_Normal,0,TYPE_ID,1),
  224.             GOCT_TextPtrTag, GODT_DrawHighText,
  225.             GOCT_SizeBodyWidth, GO_TSIZE(GOM_StdSet,100,GOT_PercTextMaxW),
  226.             GOCT_SizeBodyHeight, GO_TSIZE(GOM_StdSet,100,GOT_PercTextMaxH),
  227.             GOCT_SizeBodyWidth, GO_TSIZE(GOM_StdAdd,500,GOT_PercCharW),
  228.             TAG_END,
  229.             GODT_BodyTextPtr, (ULONG)&"",
  230.             GODT_SetTextMode, FLGALL(TXTMD_LEFT | TXTMD_ENDRIGHT | TXTMD_RELTOP),
  231.             GODT_MoveTo, GO_SCLPNT(0,0,0,0,0),
  232.             GODT_DrawHighText, (ULONG)&"Type: ",
  233.             GODT_DrawStdTextTag, GODT_BodyTextPtr,
  234.             TAG_END,
  235.             
  236.             GO_DRAWBOX(GOSD_Normal,0,AUTOSCROLL_ID,0),
  237.             GOCT_TextPtrTag, GODT_DrawHighText,
  238.             GOCT_MoreTextPtrTag, GODT_BodyTextPtr,
  239.             GOCT_SizeBodyWidth, GO_TSIZE(GOM_StdSet,100,GOT_PercTextAddW),
  240.             GOCT_SizeBodyHeight, GO_TSIZE(GOM_StdSet,100,GOT_PercTextMaxH),
  241.             TAG_END,
  242.             GODT_BodyTextPtr, (ULONG)&"",
  243.             GODT_SetTextMode, FLGALL(TXTMD_LEFT | TXTMD_ENDRIGHT | TXTMD_RELTOP),
  244.             GODT_MoveTo, GO_SCLPNT(0,0,0,0,0),
  245.             GODT_DrawHighText, (ULONG)&" Autoscroll: ",
  246.             GODT_DrawStdTextTag, GODT_BodyTextPtr,
  247.             TAG_END,
  248.             
  249.         GO_ENDGRP(),
  250.  
  251.         GO_HORIZGRP(0,0,1), TAG_END,
  252.         
  253.             GO_DRAWBOX(GOSD_Normal,0,FONTNAME_ID,1),
  254.             GOCT_TextPtrTag, GODT_DrawHighText,
  255.             GOCT_SizeBodyWidth, GO_TSIZE(GOM_StdSet,100,GOT_PercTextMaxW),
  256.             GOCT_SizeBodyHeight, GO_TSIZE(GOM_StdSet,100,GOT_PercTextMaxH),
  257.             GOCT_SizeBodyWidth, GO_TSIZE(GOM_StdAdd,500,GOT_PercCharW),
  258.             TAG_END,
  259.             GODT_BodyTextPtr, (ULONG)&"",
  260.             GODT_SetTextMode, FLGALL(TXTMD_LEFT | TXTMD_ENDRIGHT | TXTMD_RELTOP),
  261.             GODT_MoveTo, GO_SCLPNT(0,0,0,0,0),
  262.             GODT_DrawHighText, (ULONG)&"Font: ",
  263.             GODT_DrawStdTextTag, GODT_BodyTextPtr,
  264.             TAG_END,
  265.             
  266.             GO_GTBOX(NUMBER_KIND, 0, FONTSIZE_ID, 0,
  267.                 (ULONG)&"Size: ", PLACETEXT_LEFT|NG_HIGHLABEL),
  268.             GOCT_SizeBodyWidth, GO_TSIZE(GOM_StdSet,300,GOT_PercChar0),
  269.             GOCT_SizeBodyHeight, GO_TSIZE(GOM_StdSet,100,GOT_PercCharH),
  270.             GOCT_SizeBodyWidth, GO_TSIZE(GOM_PadSet,0,GOT_Pixels),
  271.             GOCT_SizeBodyHeight, GO_TSIZE(GOM_PadSet,0,GOT_Pixels),
  272.             TAG_END,
  273.             GTNM_Number, 0,
  274.             GA_Disabled, FALSE,
  275.             TAG_END,
  276.  
  277.         GO_ENDGRP(),
  278.         
  279.     GO_ENDGRP(),
  280.  
  281. GO_ENDGRP(),
  282.  
  283. GO_ENDOUTLINE()
  284. };
  285.  
  286. /**
  287.  ** Handler for examine window
  288.  **/
  289.  
  290. #define TEXT_LEN 256
  291.  
  292. struct examine_globals {
  293.     struct List window_list;            // List of windows
  294.     struct Hook bf_hook;
  295.  
  296.     UBYTE title_text[TEXT_LEN];         // screen's title
  297.     UBYTE pubname_text[TEXT_LEN];       // screen's public name
  298.     UBYTE font_text[40];                // screen's font name
  299. };
  300.  
  301. struct window_entry {
  302.     struct Node node;       // ln_Name points to &title[0]
  303.     UBYTE title[1];         // rest of structure is title.
  304. };
  305.  
  306. static ULONG __saveds __interrupt
  307. examine_handler(struct GadOutline *go, ULONG command, struct GOIMsg *msg)
  308. {
  309.     struct examine_globals *gl;
  310.     struct Gadget *gadget;
  311.     ULONG class;
  312.     UWORD code;
  313.     UWORD qual;
  314.  
  315.     if(go == NULL) return HNDRES_CLOSEWIN;
  316.  
  317.     if( !(gl = (struct examine_globals *)go->go_UserData) ) {
  318.         return HNDRES_CLOSEWIN;
  319.     }
  320.  
  321.     if(command == HNDCMD_IDCMPMSG) {
  322.         if( msg ) {
  323.             class = msg->StdIMsg.Class;
  324.             code = msg->StdIMsg.Code;
  325.             qual = msg->StdIMsg.Qualifier;
  326.             gadget = (struct Gadget *)msg->StdIMsg.IAddress;
  327.         } else {
  328.             return HNDRES_CLOSEWIN;
  329.         }
  330.     } else if(command == HNDCMD_SHUTDOWN) {
  331.         if(go == (struct GadOutline *)msg) {
  332.             DestroyExamine(go);
  333.         }
  334.         return HNDRES_NORMAL;
  335.     } else if(command == HNDCMD_MOVEWIN) {
  336.         if(msg) {
  337.             UnlockGadOutline(go);   // Window must be unlocked.
  338.             if( !GO_OpenWindow(go,
  339.                     WA_CustomScreen, (struct Window *)msg,
  340.                     TAG_END) ) {
  341.                 return HNDRES_CLOSEWIN;
  342.             }
  343.             return HNDRES_NORMAL;
  344.         } else return HNDRES_CLOSEWIN;
  345.     } else if(command == HNDCMD_HIDEWIN) {
  346.         UnlockGadOutline(go);   // Window must be unlocked.
  347.         GO_CloseWindow(go);
  348.         return HNDRES_NORMAL;
  349.     } else if(command == HNDCMD_LOCK) {
  350.         LockGadOutline(go);
  351.         return HNDRES_NORMAL;
  352.     } else if(command == HNDCMD_UNLOCK) {
  353.         UnlockGadOutline(go);
  354.         return HNDRES_NORMAL;
  355.     } else {
  356.         return HNDRES_NORMAL;
  357.     }
  358.  
  359.     switch (class) {
  360.  
  361.         case IDCMP_CLOSEWINDOW:
  362.         {
  363.             return HNDRES_CLOSEWIN;
  364.         } break;
  365.  
  366.         case IDCMP_REFRESHWINDOW:
  367.         {
  368.             GO_BeginRefresh(go);
  369.             GO_EndRefresh(go, TRUE);
  370.         } break;
  371.  
  372.     }
  373.     
  374.     return HNDRES_NORMAL;
  375. }
  376.  
  377. void DestroyExamine(struct GadOutline *go)
  378. {
  379.     struct examine_globals *gl;
  380.     struct Node *curnode;
  381.  
  382.     if(!go) return;
  383.     gl = go->go_UserData;
  384.     
  385.     UnlockGadOutline(go);   // Window must be unlocked.
  386.     FreeGadOutline(go);
  387.         
  388.     if(gl) {
  389.     
  390.         // Free list of windows.
  391.         while( (curnode = RemTail(&gl->window_list)) != NULL ) {
  392.             FreeVec(curnode);
  393.         }
  394.         
  395.         // Free global variables.
  396.         FreeVec(gl);
  397.     }
  398. }
  399.  
  400. struct GadOutline *CreateExamine(struct GadOutline *par_go,
  401.                                  UBYTE *name,struct Screen *scrn)
  402. {
  403.     struct GadOutline *go;
  404.     struct examine_globals *gl;
  405.     
  406.     if(!par_go || !par_go->go_Window) return NULL;
  407.     
  408.     go = AllocGadOutline(&examine_outline[0],
  409.             GOA_OutlineSize,    sizeof(examine_outline),
  410.             GOA_UserIDCMP,      par_go->go_MsgPort,
  411.             TAG_END);
  412.     if(!go) return NULL;
  413.     
  414.     gl = AllocVec(sizeof(struct examine_globals),MEMF_PUBLIC|MEMF_CLEAR);
  415.     if(!gl) {
  416.         DestroyExamine(go);
  417.         return NULL;
  418.     }
  419.     
  420.     NewList(&gl->window_list);
  421.     go->go_UserData = gl;
  422.  
  423.     SetupBackFillHook(&gl->bf_hook,go);
  424.     GO_SetObjAttrs(go,WINTAGS_ID,0,WA_BackFill,&gl->bf_hook,TAG_END);
  425.  
  426.     strncpy(&gl->title_text[0],scrn->DefaultTitle,TEXT_LEN-2);
  427.     strncpy(&gl->pubname_text[0],name,TEXT_LEN-2);
  428.     if(scrn->Font) {
  429.         strncpy(&gl->font_text[0],scrn->Font->ta_Name,36);
  430.     } else {
  431.         strncpy(&gl->font_text[0],"- None -",36);
  432.     }
  433.  
  434.     Forbid();
  435.     {
  436.         struct Window *win = scrn->FirstWindow;
  437.         struct window_entry *win_node;
  438.         UBYTE *title;
  439.         
  440.         while(win) {
  441.             if( !(title = win->Title) ) title = "- None -";
  442.             if(win_node = AllocVec(sizeof(struct window_entry)+strlen(title)+5,
  443.                                     MEMF_CLEAR|MEMF_PUBLIC)) {
  444.                 strcpy(&win_node->title[0],title);
  445.                 win_node->node.ln_Name = &win_node->title[0];
  446.                 AddTail(&gl->window_list,&win_node->node);
  447.             }
  448.             win = win->NextWindow;
  449.         }
  450.     }
  451.     Permit();
  452.     
  453.     GO_SetObjAttrs(go,TITLE_ID,0, GODT_BodyTextPtr,&gl->title_text[0],TAG_END);
  454.     GO_SetObjAttrs(go,PUBNAME_ID,0, GODT_BodyTextPtr,&gl->pubname_text[0],TAG_END);
  455.     
  456.     GO_SetObjAttrs(go,WINLIST_ID,0, GTLV_Labels,&gl->window_list,TAG_END);
  457.     GO_SetObjAttrs(go,LEFT_ID,0, GTNM_Number,scrn->LeftEdge,TAG_END);
  458.     GO_SetObjAttrs(go,TOP_ID,0, GTNM_Number,scrn->TopEdge,TAG_END);
  459.     GO_SetObjAttrs(go,WIDTH_ID,0, GTNM_Number,scrn->Width,TAG_END);
  460.     GO_SetObjAttrs(go,HEIGHT_ID,0, GTNM_Number,scrn->Height,TAG_END);
  461.     
  462.     if( (scrn->Flags&SCREENTYPE) == WBENCHSCREEN ) {
  463.         GO_SetObjAttrs(go,TYPE_ID,0, GODT_BodyTextPtr,"Workbench",TAG_END);
  464.     } else if( (scrn->Flags&SCREENTYPE) == PUBLICSCREEN ) {
  465.         GO_SetObjAttrs(go,TYPE_ID,0, GODT_BodyTextPtr,"Public",TAG_END);
  466.     } else if( (scrn->Flags&SCREENTYPE) == CUSTOMSCREEN ) {
  467.         GO_SetObjAttrs(go,TYPE_ID,0, GODT_BodyTextPtr,"Custom",TAG_END);
  468.     } else {
  469.         GO_SetObjAttrs(go,TYPE_ID,0, GODT_BodyTextPtr,"Unknown",TAG_END);
  470.     }
  471.         
  472.     if( (scrn->Flags&AUTOSCROLL) ) {
  473.         GO_SetObjAttrs(go,AUTOSCROLL_ID,0, GODT_BodyTextPtr,"On",TAG_END);
  474.     } else {
  475.         GO_SetObjAttrs(go,AUTOSCROLL_ID,0, GODT_BodyTextPtr,"Off",TAG_END);
  476.     }
  477.  
  478.     GO_SetObjAttrs(go,FONTNAME_ID,0, GODT_BodyTextPtr,&gl->font_text[0],TAG_END);
  479.     if(scrn->Font) {
  480.         GO_SetObjAttrs(go,FONTSIZE_ID,0, GTNM_Number,scrn->Font->ta_YSize,TAG_END);
  481.     }
  482.  
  483.     if( !GO_OpenWindow(go,
  484.             WA_CustomScreen, par_go->go_Screen,
  485.             TAG_END) ) {
  486.         DestroyExamine(go);
  487.         return NULL;
  488.     }
  489.     
  490.     return go;
  491. }
  492.