home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 2
/
fishmore-publicdomainlibraryvol.ii1991xetec.iso
/
fish
/
science
/
chemesthetics
/
source
/
messagereq.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-12-06
|
1KB
|
40 lines
#include <intuition/intuitionbase.h>
/* messagereq.c: ruft Messagerequester auf */
struct Gadget MOK =
{
NULL, 0, 40, 90, 14, GADGHCOMP, RELVERIFY | ENDGADGET, BOOLGADGET | REQGADGET, NULL,
NULL, NULL, 0, NULL, 41, NULL
};
struct Requester MsgReq =
{
NULL, 0, 0, 120, 60, 0, 0, &MOK, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL
};
void MessageReq(Window, text, background, shadow, textcol)
struct Window *Window;
char *text;
int background, shadow, textcol;
{
register int ende = 0;
if ((strlen(text) * 8 + 15) > 120)
MsgReq.Width = strlen(text) * 8 + 20;
MsgReq.LeftEdge = (640 - MsgReq.Width) / 2;
MsgReq.TopEdge = (256 - MsgReq.Height) / 2;
MOK.LeftEdge = MsgReq.Width - 115;
Request(&MsgReq, Window);
ReqBlock(&MsgReq, shadow, 4, 2, MsgReq.Width - 4, 58);
ReqBlock(&MsgReq, background, 0, 0, MsgReq.Width - 4, 58);
ReqBox(&MsgReq, textcol, background, 2, 1, MsgReq.Width - 8, 56);
ReqPrint(&MsgReq, text, textcol, background, 10, 20);
ReqBox(&MsgReq, textcol, background, MOK.LeftEdge - 1, 39, 92, 16);
ReqPrint(&MsgReq, "OK", textcol, background, MOK.LeftEdge + 37, 49);
while (!ende)
{
if (Nachricht(Window) == GADGETUP)
ende++;
}
}