home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************
-
- ShowWin.c
-
- This file should be linked together with a compiled version
- of Stolen.c, or whatever it's name may be. That file must
- contain the following:
- - A NewWindow structure: The Window to be shown;
- Note that a Menu hanging from the Window should be stolen sperately
- because a struct NewWindow cannot contain sucha a field.
-
- Rick van Rein, October 2, 1990
-
- ****************************************************************************/
-
-
-
- #include <functions.h>
-
- #include <Intuition/Intuition.h>
-
-
- struct IntuitionBase *IntuitionBase;
-
- extern struct NewWindow *nwin1;
-
-
- /***** This routine opens a Window with a Close-Gadget in it: */
-
-
- #define BLUE_0 0
- #define WHITE_1 1
- #define BLACK_2 2
- #define ORANGE_3 3
-
-
- struct NewWindow closewin =
- {
- 30,30, /* LeftEdge,TopEdge */
- 360,10, /* Width,Height */
- BLUE_0,WHITE_1, /* DetailPen,BlockPen */
- CLOSEWINDOW, /* IDCMPFlags */
- WINDOWDRAG | WINDOWDEPTH | WINDOWCLOSE | SMART_REFRESH,
- /* Flags */
- NULL, /* FirstGadget */
- NULL, /* CheckMark */
- (UBYTE *) " <<< Click here to finish ShowWin ",
- /* Title */
- NULL, /* Screen */
- NULL, /* BitMap */
- -1,-1, /* MinWidth,MinHeight */
- -1,-1, /* MaxWidth,MaxHeight */
- WBENCHSCREEN /* Type */
- };
-
- void WaitForClick ()
- {
- struct Window *win;
-
- if (win=OpenWindow (&closewin))
- {
- WaitPort (win->UserPort);
- ReplyMsg (GetMsg (win->UserPort)); /* Our Gadget was Clicked */
- CloseWindow (win);
- }
- else
- puts ("\tShowWin: Can't open Window on Workbench Screen");
- }
-
-
- /***** The main routine of the showing mechanism: */
-
- main ()
- {
- struct Window *win;
-
- if (!(IntuitionBase=(struct IntuitionBase *) OpenLibrary ("intuition.library",0L)))
- {
- puts ("\tShowWin: Can't open intuition.library (?)");
- exit (0);
- }
-
- if (! (win=OpenWindow (&nwin1)))
- puts ("\tShowWin: Can't open Window to be shown");
- else
- {
- WaitForClick ();
- CloseWindow (win);
- }
-
- CloseLibrary (IntuitionBase);
- }
-