home *** CD-ROM | disk | FTP | other *** search
- FUNCTION createwindow() - create a fully spec'ed Intuition window
-
- struct Window *createwindow(screen, flags, idcmp,
- leftedge, topedge,
- width, height)
- struct Screen *screen;
- ULONG flags, idcmp;
- int leftedge, topedge, width, height;
-
- This function allows you the most flexibility over specifying a window.
- Essentially, you can create any type of window you would like with this
- call. Flags and idcmp are exactly as you would specify in a NewWindow
- structure, and are passed directly through. If you specify screen as
- non-NULL, the window will be opened on that screen.
-
- Some error checking of your position variables is done, however it is
- still possible to screw yourself if you get too outlandish (like negative
- leftedge, etc). Keep this in mind if passing negative numbers could be a
- problem.
-
- A pointer to the freshly created window will be returned, or NULL if
- the window could not be opened. You should definitely error check the
- return from this function.
-
- To open a simple window with only a title bar, disk inserted messages
- from Intuition, at 100,50 and 200 pixels wide by 75 pixels high, you would
- do the following :
-
- struct Window *win;
-
- win = createwindow(NULL, WINDOWDRAG, DISKINSERTED, 100,50, 200, 75)
- if (win == NULL)
- no_window();
-
- The function call above simply asks for a window with a title bar, and
- an Intuition port to which DISKINSERTED messages will arrive. The window
- would have a top corner at 100,50, and would be 200 pixels wide and 75
- pixels high.
-
- Of course you can specify any combination of flags and idcmp messages.
- You must make sure they make sense to your application however. For
- example it would not make much sense to ask for CLOSEWINDOW Intuition
- messages if you have not asked for a Close Gadget in the flags variable.
-
-
- TODO : probably should error check the flags/idcmp arguments and modify the
- flags argument to agree with the idcmp arg. This would be to take
- care of problems such as in the last paragraph.
-
- BUGS : bunny?
-
- SEE ALSO : makewindow(), makescreen()
-
-
-
-
-