home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d8xx / d886 / goalkeeper.lha / GoalKeeper / Sources / ShowText.c < prev    next >
C/C++ Source or Header  |  1993-07-16  |  696b  |  36 lines

  1. #include <intuition/intuition.h>
  2.  
  3. extern struct IntuitionBase *IntuitionBase;
  4.  
  5. extern struct TextAttr  Style;
  6.  
  7. struct IntuiText Body =
  8. {
  9.    0, 1, JAM2, 10, 10, &Style,
  10.    NULL, NULL
  11. };
  12.  
  13. struct IntuiText NegText =
  14. {
  15.    0, 1, JAM2, 5, 3, &Style,
  16.    NULL , NULL
  17. };
  18.  
  19.  
  20. void ShowText(Window, str1, str2)
  21. struct Window  *Window;
  22. UBYTE  str1[], str2[];
  23. {
  24.    ULONG  Width1, Width2, Height;
  25.  
  26.    Body.IText = str1;
  27.    if (str2) NegText.IText = str2;
  28.    else NegText.IText = (UBYTE *)" OK ";
  29.    Width1 = IntuiTextLength(&Body) + 60;
  30.    Width2 = IntuiTextLength(&NegText) + 60;
  31.    Height = 60;
  32.    if (Width2 > Width1) Width1 = Width2;
  33.    AutoRequest(Window, &Body, NULL, &NegText, 0L, 0L, Width1, Height);
  34. }
  35.  
  36.