home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 432b.lha / EzLib / doc / createwindow.doc < prev    next >
Text File  |  1990-11-10  |  2KB  |  57 lines

  1. FUNCTION  createwindow()  -  create a fully spec'ed Intuition window
  2.  
  3.        struct Window *createwindow(screen, flags, idcmp,
  4.                        leftedge, topedge,
  5.                        width, height)
  6.                struct Screen *screen;
  7.                ULONG flags, idcmp;
  8.                int leftedge, topedge, width, height;
  9.  
  10.     This function allows you the most flexibility over specifying a window.
  11. Essentially, you can create any type of window you would like with this
  12. call.  Flags and idcmp are exactly as you would specify in a NewWindow
  13. structure, and are passed directly through.  If you specify screen as
  14. non-NULL, the window will be opened on that screen.
  15.  
  16.     Some error checking of your position variables is done, however it is
  17. still possible to screw yourself if you get too outlandish (like negative
  18. leftedge, etc).  Keep this in mind if passing negative numbers could be a
  19. problem.
  20.  
  21.     A pointer to the freshly created window will be returned, or NULL if
  22. the window could not be opened.  You should definitely error check the
  23. return from this function.
  24.  
  25.     To open a simple window with only a title bar, disk inserted messages
  26. from Intuition, at 100,50 and 200 pixels wide by 75 pixels high, you would
  27. do the following :
  28.  
  29.       struct Window *win;
  30.  
  31.       win = createwindow(NULL, WINDOWDRAG, DISKINSERTED, 100,50, 200, 75)
  32.       if (win == NULL)
  33.     no_window();
  34.  
  35.    The function call above simply asks for a window with a title bar, and
  36. an Intuition port to which DISKINSERTED messages will arrive.  The window
  37. would have a top corner at 100,50, and would be 200 pixels wide and 75
  38. pixels high.
  39.  
  40.    Of course you can specify any combination of flags and idcmp messages.
  41. You must make sure they make sense to your application however.  For
  42. example it would not make much sense to ask for CLOSEWINDOW Intuition
  43. messages if you have not asked for a Close Gadget in the flags variable.
  44.  
  45.  
  46. TODO : probably should error check the flags/idcmp arguments and modify the
  47.        flags argument to agree with the idcmp arg.  This would be to take
  48.        care of problems such as in the last paragraph.
  49.  
  50. BUGS : bunny?
  51.  
  52. SEE ALSO : makewindow(), makescreen()
  53.  
  54.  
  55.  
  56.  
  57.