home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
348.lha
/
chatterbox_v1.0
/
sources
/
display.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-02-14
|
999b
|
59 lines
#include <functions.h>
#include <exec/types.h>
#include <exec/devices.h>
#include <graphics/gfx.h>
#include <intuition/intuition.h>
#include <ctype.h>
extern struct NewWindow XNewWindowStructure1;
extern struct Menu XMenu1;
struct Window *win = NULL;
struct GfxBase *GfxBase = NULL;
struct IntuitionBase *IntuitionBase = NULL;
int display_up;
trash_libs()
{
if (GfxBase)
CloseLibrary(GfxBase);
if (IntuitionBase)
CloseLibrary(IntuitionBase);
}
InitLibraries()
{
add_cleanup(trash_libs);
if(!(GfxBase = (struct GfxBase *)OpenLibrary("graphics.library", 0L)))
panic("Can't open graphics.library");
if (!(IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library",0L)))
panic("Can't open intuition.library");
}
trash_window()
{
if (win)
{
ClearMenuStrip(win);
CloseWindow(win);
}
}
InitWindow()
{
int i;
win = 0;
if (!(win = OpenWindow(&XNewWindowStructure1)))
panic("can't open window");
SetMenuStrip(win,&XMenu1);
add_cleanup(trash_window);
}