Article View: comp.sys.amiga.tech
Article #1866Errant Wait() call
From: Allen Farrington
Date: Tue, 24 Oct 1989 20:32
Date: Tue, 24 Oct 1989 20:32
92 lines
2438 bytes
2438 bytes
This being my foray into the Wait() function, I seem to
need a bit of assistance. I've included my program below
without the comments except for the one above the call to
Wait(). The problem is this, the window opens correctly
but will not close. When I click on the close gadget,
the box highlights briefly but nothing further happens.
If I substitute a null FOR loop for the Wait(), the
window opens, remains briefly, and closes correctly.
Any help would be appreciated.
--Allen
/********** Start of Program ***********/
#include <exec/types.h>
#include <intuition/intuition.h>
struct Window *OpenWindow();
struct IntuitionBase *IntuitionBase;
struct GfxBase *GfxBase;
void *OpenLibrary();
struct Window *Wdw;
#define BLUP 0
#define WHTP 1
#define BLKP 2
#define ORNP 3
struct NewWindow NewWdw =
{
0,0,
640,200,
BLUP, WHTP,
CLOSEWINDOW,
SMART_REFRESH | ACTIVATE | WINDOWCLOSE,
NULL,
NULL,
NULL,
NULL,
NULL,
0,0,
0,0,
WBENCHSCREEN
};
main()
{
IntuitionBase = ( struct IntuitionBase *)
OpenLibrary( "intuition.library", LIBRARY_VERSION );
if ( IntuitionBase == NULL )
{
printf( "No Intuition.\n" );
exit( FALSE );
}
GfxBase = ( struct GfxBase *)
OpenLibrary( "graphics.library", LIBRARY_VERSION );
if ( GfxBase == NULL )
{
printf( "No Graphics.\n" );
exit( FALSE );
}
Wdw = (struct Window *)OpenWindow( &NewWdw );
if( Wdw == NULL )
{
printf( "No Window.\n" );
exit( FALSE );
}
/* ERROR occurs here, I think */
Wait( 1 << Wdw->UserPort->mp_SigBit );
CloseWindow( Wdw );
CloseLibrary( GfxBase );
CloseLibrary( IntuitionBase );
}
--
|======================================================================|
| Allen H. Farrington smart: allen@tcville.hac.com |
| (213) 436-0483 CompuServe: 74010,1775 |
|======================================================================|
Technical Details
Message-ID:
<292@tcville.HAC.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!ginosko!usc!hacgate!tcville!allenShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!ginosko!usc!hacgate!tcville!allen From: allen@tcville.HAC.COM (Allen Farrington) Newsgroups: comp.sys.amiga.tech Subject: Errant Wait() call Keywords: Wait() Message-ID: <292@tcville.HAC.COM> Date: 24 Oct 89 20:32:58 GMT Organization: Hughes EDSG,El Segundo,CA Lines: 92