home *** CD-ROM | disk | FTP | other *** search
- #include "Wimp.h"
- #include "WimpSWIs.h"
- #include "SWI.h"
- #include "Event.h"
-
-
- #define SWI_OS_ReadMonotonicTime 0x20042
-
- extern void Icon_ClickWait(int waittime)
- {
- static int waitingonclick = FALSE;
- int time;
- event_pollblock event;
- event_pollmask mask;
-
- if (waitingonclick) /* Don't allow re-entrant call on this function */
- return;
-
- waitingonclick = TRUE;
-
- SWI(0, 1, SWI_OS_ReadMonotonicTime, &time);
- time += waittime;
-
- do
- {
- mask.value = 0; /* enable null polls */
- Wimp_PollIdle(mask, &event, time); /* Wait until time up or event */
-
- if (event.type != event_CLICK && event.type != event_NULL)
- Event_Process(&event); /* Process this event */
-
- } while (event.type == event_CLICK || event.type == event_REDRAW);
-
- /* Wait until not a button click event, and also ignore redraws as a
- * termination condition, as redraw is very likely (indenting a button)
- * on the first poll after the click which called us!
- */
-
- waitingonclick = FALSE;
- }
-