synchronized void deleteEvents(EventDeleter deleter)
synchronized int doOneEvent(int flags)
static synchronized Notifier getNotifierForThread(Thread thread)
synchronized void preserve()
synchronized void queueEvent(TclEvent event, int pos)
synchronized void release()
If a Java module intends to use a Notifier returned by getNotifierForThread over one or more method calls, it should call preserve immediately after getNotifierForThread returns. The module should call relase when it no longer needs access to the notifier.
NOTE: the notifier returned by interp.getNotifier will remain valid as long as the Interpreter is valid. Hence, if a module always access a notifier via calls to interp.getNotifier, it needs not use the notifier's preserve and release methods.
If the flags argument to doOneEvent is non-zero, it restricts the kinds of events that will be processed by doOneEvent. Flags may be an OR-ed combination of any of the following bits:
If any of the flags TCL.WINDOW_EVENTS, TCL.FILE_EVENTS, TCL.TIMER_EVENTS, or TCL.IDLE_EVENTS is set, then the only events that will be considered are those for which flags are set. Setting none of these flags is equivalent to the value TCL.ALL_EVENTS, which causes all event types to be processed. If an application has additional event sources then additional flag values may also be valid, depending on those event sources.
The TCL.DONT_WAIT flag causes doOneEvent not to put the process to sleep: it will check for events but if none are found then it returns immediately with a return value of 0 to indicate that no work was done. doOneEvent will also return 0 without doing anything if the only alternative is to block forever (this can happen, for example, if flags is TCL.IDLE_EVENTS and there are no idle callbacks pending, or if no event handlers or timer handlers exist).
doOneEvent may be invoked recursively. For example, it is possible to invoke doOneEvent recursively from an event handler called by doOneEvent. This sort of operation is useful in some modal situations, such as when a notification dialog has been popped up and an application wishes to wait for the user to click a button in the dialog before doing anything else.
Copyright © 1998 Sun Microsystems, Inc. Copyright © 1995-1997 Roger E. Critchlow Jr.