/* 
 * Motif Tools Library, Version 2.0
 * $Id: Discard.c,v 2.9 1994/07/04 03:03:50 david Exp $
 * 
 * Written by David Flanagan.
 * Copyright (c) 1992, 1993, 1994 by Dovetail Systems.
 * All Rights Reserved.  See the file COPYRIGHT for details.
 * This is not free software.  See the file SHAREWARE for details.
 * There is no warranty for this software.  See NO_WARRANTY for details.
 */

#include <Xmt/Xmt.h>
#include <Xmt/Util.h>

#if NeedFunctionPrototypes
void XmtDiscardButtonEvents(Widget w)
#else
void XmtDiscardButtonEvents(w)
Widget w;
#endif
{
    Display *dpy = XtDisplay(w);
    XEvent event;
    
    XSync(dpy, False);  /* get any events from the server */
    while (XCheckMaskEvent(dpy,
			   ButtonPressMask | ButtonReleaseMask |
			   ButtonMotionMask | PointerMotionMask,
			   &event))
	;
}


#if NeedFunctionPrototypes
void XmtDiscardKeyPressEvents(Widget w)
#else
void XmtDiscardKeyPressEvents(w)
Widget w;
#endif
{
    Display *dpy = XtDisplay(w);
    XEvent event;
    
    XSync(dpy, False);  /* get any events from the server */
    while (XCheckMaskEvent(dpy, KeyPressMask, &event))
	;
}

