home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Entertainment / Concentration / Debug.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-05  |  841 b   |  49 lines  |  [TEXT/KAHL]

  1. /*
  2.  * Debug.c - debug window
  3.  */
  4.  
  5. # include    "TransSkel.h"
  6. # include    "TransDisplay.h"
  7. # include    "Debug.h"
  8.  
  9.  
  10. static WindowPtr    dWind = (WindowPtr) nil;
  11.  
  12. /*
  13.  * Initialize debug window, taking care not to disturb the current port
  14.  */
  15.  
  16. void
  17. SetupDebugWindow (void)
  18. {
  19. Rect        bounds;
  20. GrafPtr        oldPort;
  21. GrafPtr        port;
  22.  
  23.     GetPort (&oldPort);
  24.     SetRect (&bounds, 0, 0, 350, 150);
  25.     dWind = NewDWindow (&bounds, (StringPtr) "\pDebug", false, nil, true, 0L);
  26.     if (dWind != (WindowPtr) nil)
  27.     {
  28.         SetDWindowStyle (dWind, 0, 0, false, teJustLeft);
  29.         GetWMgrPort (&port);
  30.         MoveWindow (dWind,
  31.                     port->portRect.right - 4 - bounds.right,
  32.                     port->portRect.bottom - 4 - bounds.bottom,
  33.                     false);
  34.     }
  35.     SetPort (oldPort);
  36. }
  37.  
  38.  
  39. void
  40. ShowDebugWindow (void)
  41. {
  42.     if (dWind != (WindowPtr) nil)
  43.     {
  44.         SelectWindow (dWind);
  45.         ShowWindow (dWind);
  46.         SkelDoUpdates ();
  47.     }
  48. }
  49.