home *** CD-ROM | disk | FTP | other *** search
- /* By Ingemar Ragnemalm, based on code by N. Jonas Englund. */
-
- //================================= INCLUDES ====================================
-
- #include "shell.h"
- #include "fade.h"
-
- //================================= FUNCTIONS ===================================
-
- void InitToolbox(void);
- void TestWindow(void);
-
- /*********************************** main ***************************************/
- extern
- void main(void)
- {
- InitToolbox();
- TestWindow();
- }
- /*** main ***/
-
- /********************************** InitToolbox ********************************/
- static
- void InitToolbox(void)
- {
- MaxApplZone();
- MoreMasters();
- #ifdef THINK_C
- InitGraf(&thePort);
- #else
- InitGraf(&qd.thePort);
- #endif
- InitFonts();
- InitWindows();
- InitMenus();
- TEInit();
- InitDialogs(nil);
- InitCursor();
- FlushEvents(everyEvent, 0);
- }
- /*** InitToolbox ***/
-
- /********************************** TestWindow *********************************/
- static
- void TestWindow(void)
- {
- DialogPtr d;
- GrafPtr g;
- short hit;
- RGBColor fadeTo = {0xefff, 0x0000, 0xffff};
-
- // Fade to pink: {0xd000, 0x4000, 0x4000};
- // Fade to green: {0x0000, 0xffff, 0x4000};
- // Fade to white: {0xffff, 0xffff, 0xffff};
-
- FadeScreen(30, true, fadeTo); //• Try fade speeds from
-
- GetPort(&g);
- d = GetNewDialog(128, nil, (WindowPtr) -1L);
- ShowWindow(d);
- DrawDialog(d);
- SetPort(d);
- ValidRect(&d->portRect);
-
- FadeScreen(30, false, fadeTo); //• 1 upward.
- ModalDialog(nil, &hit);
-
- FadeScreen(30, true, fadeTo); //• Try fade speeds from
- SetPort(g);
- DisposeDialog(d);
- FadeScreen(30, false, fadeTo); //• 1 upward.
- }
- /*** TestWindow ***/
-
- //===================================== EOF =====================================