home *** CD-ROM | disk | FTP | other *** search
- /**
- ** Check out DynamicNode routines ;-)
- ** Holgi (29-Jul-94) width MaxonC
- **
- ** Tabsize = 3
- **/
-
- #include <exec/types.h>
- #include <pragma/exec_lib.h>
- #include <pragma/gadtools_lib.h>
- #include <pragma/intuition_lib.h>
- #include <intuition/gadgetclass.h>
-
- #include "DynamicNodes.h"
-
- struct Library *GadToolsBase;
- struct Library *IntuitionBase;
-
- struct Screen *MyScr;
- struct DrawInfo *MyDrInfo;
- struct VisualInfo *VisualInfo;
- struct Gadget *FooGG;
- struct IntuiMessage *IMsg;
- struct Window *MyWin;
- struct List MyList;
-
- struct Gadget *GGList = NULL;
- STRPTR FileName = "S:User-Startup";
-
- void main( void );
- void wbmain( struct WBStartup *ws ) { main(); }
-
- void main( void )
- {
- if( GadToolsBase = OpenLibrary( "gadtools.library", 36 ))
- {
- if( IntuitionBase = OpenLibrary( "intuition.library", 36 ))
- {
- if( LoadTextNodes( FileName, &MyList ))
- {
- if( MyScr = LockPubScreen( NULL ))
- {
- MyDrInfo = GetScreenDrawInfo( MyScr );
- if( VisualInfo = GetVisualInfoA( MyScr, NULL ))
- {
- if( FooGG = CreateContext( &GGList ))
- {
- struct NewGadget MyNewGG = {
- MyScr->WBorLeft, MyScr->BarHeight + 1,
- (MyDrInfo->dri_Font->tf_XSize << 5) + 14,
- ((MyDrInfo->dri_Font->tf_YSize + 1) << 3) + 4,
- NULL, MyScr->Font, 0, 0, VisualInfo, NULL
- };
- struct TagItem MyGGTags[] = {
- GTLV_Labels,(ULONG) &MyList, GTLV_ReadOnly,TRUE,
- GTLV_ScrollWidth,(MyDrInfo->dri_Font->tf_XSize << 1) + 2,
- LAYOUTA_Spacing,1, TAG_DONE,0
- };
- if( CreateGadgetA( LISTVIEW_KIND, FooGG, &MyNewGG, MyGGTags ))
- {
- struct TagItem MyWinTags[] = {
- WA_IDCMP,IDCMP_CLOSEWINDOW | LISTVIEWIDCMP,
- WA_Gadgets,(ULONG) GGList, WA_Title,(ULONG) FileName,
- WA_DragBar,TRUE, WA_DepthGadget,TRUE, WA_CloseGadget,TRUE,
- WA_NoCareRefresh,TRUE, WA_Activate,TRUE, WA_RMBTrap,TRUE,
- WA_SmartRefresh,TRUE, WA_AutoAdjust,TRUE,
- WA_InnerWidth,MyNewGG.ng_Width,
- WA_InnerHeight,MyNewGG.ng_Height,
- WA_PubScreen,(ULONG) MyScr, TAG_DONE,0
- };
- if( MyWin = OpenWindowTagList( NULL, MyWinTags ))
- {
- BOOL Finished = FALSE;
-
- GT_RefreshWindow( MyWin, NULL );
- while( !Finished )
- {
- WaitPort( MyWin->UserPort );
- while( IMsg = GT_GetIMsg( MyWin->UserPort ))
- {
- if( IMsg->Class == IDCMP_CLOSEWINDOW )
- Finished = TRUE;
- GT_ReplyIMsg( IMsg );
- }
- }
- CloseWindow( MyWin );
- }
- }
- FreeGadgets( GGList );
- }
- FreeVisualInfo( VisualInfo );
- }
- FreeScreenDrawInfo( MyScr, MyDrInfo );
- UnlockPubScreen( NULL, MyScr );
- }
- FreeList( &MyList );
- }
- CloseLibrary( IntuitionBase );
- }
- CloseLibrary( GadToolsBase );
- }
- }
-