home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / dirs / prettywindows_399.lzh / PrettyWindows / pwwindow.c < prev    next >
C/C++ Source or Header  |  1990-11-02  |  2KB  |  64 lines

  1. #include <exec/types.h>
  2. #include <intuition/intuition.h>
  3.  
  4. /********************************************
  5.  *  PrettyWindows v1.0   by Thom Robertson  *
  6.  ********************************************/
  7.  
  8. /*
  9.  
  10. This routine opens a window.
  11. The screen argument is a pointer to a Screen structure (this screen
  12. must be open).  If the screen pointer is NULL (0), the window will open on
  13. the Workbench screen.  The arguments are size variables.
  14. This routine returns the pointer to this window's Window structure if it
  15. was successful, otherwise it returns NULL (0).
  16. When called, it is assumed that the Intuition Library has already been
  17. called.  If not, BOOM!
  18. If the window is larger than the screen, or is positioned off the edge of
  19. the screen, this routine may go BOOM.
  20. Note that since this window is BORDERLESS and has no gadgets or title, it
  21. will be completely blank until you put something in it.  Don't let this
  22. throw you.
  23.  
  24. */
  25.  
  26. makewindow(screen,x,y,w,h)
  27. struct Screen *screen;
  28. int x,y,w,h;
  29. {
  30.  
  31.     struct NewWindow NewWindow;
  32.     struct Window *Window;
  33.  
  34.     NewWindow.LeftEdge = x;
  35.     NewWindow.TopEdge = y;
  36.     NewWindow.Width = w;
  37.     NewWindow.Height = h;
  38.     NewWindow.DetailPen = 0;
  39.     NewWindow.BlockPen = 1;
  40.     NewWindow.Title = NULL;
  41.     NewWindow.Flags = ACTIVATE;
  42.     NewWindow.IDCMPFlags = MOUSEBUTTONS+MOUSEMOVE+GADGETDOWN+GADGETUP+
  43.         MENUPICK+RAWKEY+ACTIVEWINDOW+INACTIVEWINDOW+BORDERLESS;
  44.     if (screen != NULL)
  45.        NewWindow.Type = CUSTOMSCREEN;
  46.     else
  47.        NewWindow.Type = WBENCHSCREEN;
  48.     NewWindow.FirstGadget = NULL;
  49.     NewWindow.CheckMark = NULL;
  50.     NewWindow.Screen = screen;
  51.     NewWindow.BitMap = NULL;
  52.     NewWindow.MinWidth = 0;
  53.     NewWindow.MinHeight = 0;
  54.     NewWindow.MaxWidth = -1;
  55.     NewWindow.MaxHeight = -1;
  56.  
  57.     if ((Window = (struct Window *)OpenWindow(&NewWindow))== NULL)
  58.         return(0);
  59.  
  60.     return(Window);
  61.  
  62. }
  63.  
  64.