home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / source / term43-source.lha / Extras / Source / gtlayout-Source.lha / LT_ShowWindow.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-16  |  786 b   |  45 lines

  1. /*  GadTools layout toolkit
  2. **
  3. **  Copyright © 1993-1994 by Olaf `Olsen' Barthel
  4. **  Freely distributable.
  5. */
  6.  
  7. #include "gtlayout_global.h"
  8.  
  9. VOID LIBENT
  10. LT_ShowWindow(REG(a0) LayoutHandle *handle,REG(a1) BOOL activate)
  11. {
  12.     if(handle)
  13.     {
  14.         struct Window *window;
  15.  
  16.         window = handle -> Window;
  17.  
  18.         WindowToFront(window);
  19.  
  20.         if(activate)
  21.             ActivateWindow(window);
  22.  
  23.         ScreenToFront(window -> WScreen);
  24.  
  25.         if(!handle -> ResizeView && (handle -> Window -> Flags & (WFLG_HASZOOM | WFLG_ZOOMED)) == (WFLG_HASZOOM | WFLG_ZOOMED))
  26.         {
  27.             WORD i;
  28.  
  29.             ZipWindow(window);
  30.  
  31.                 // wait for the window to unzoom before calling LTP_MoveToWindow()
  32.  
  33.             for(i = 0 ; i < 300 ; i++)
  34.             {
  35.                 if(!handle -> Window -> Flags & WFLG_ZOOMED)
  36.                     break;
  37.  
  38.                 WaitTOF();
  39.             }
  40.         }
  41.  
  42.         LTP_MoveToWindow(handle);
  43.     }
  44. }
  45.