Path: utzoo!attcan!uunet!husc6!bloom-beacon!mit-vax!josh From: josh@mit-vax.LCS.MIT.EDU (Joshua Marantz) Newsgroups: comp.windows.x Subject: Another toolkit question Message-ID: <5120@mit-vax.LCS.MIT.EDU> Date: 20 Nov 88 23:45:39 GMT Organization: MIT LCS, Cambridge, MA Lines: 31 [Summary: How do I detect typeahead in the toolkit?] Text editors often check the event queue for typeahead so that they can abort screen refreshes. This allows (for example) emacs to be effectively used at low baud rates. Emacs can simply ask whether there is any input pending or not because it is capable of efficiently regenerating the display even if the typed-ahead character didn't do very much. An editor that had a more difficult time regenerating partially corrupt displays might need to determine whether any of the typed-ahead characters would cause a major refresh, and thereby justify interrupting the current refresh. To accomplish this in the toolkit, we would need to have a function XtWidgetMaskIfEvent (widget, event_mask, predicate, user_data); that calls the predicate for each event that is included in the mask and is pending on the specified widget. Even better would be to take advantage of the toolkit's translation management, rather than passing in raw events. I'm not quite sure what form this would take. Can I do something like that with the existing intrinsics? -Joshua Marantz Viewlogic Systems, Inc.