Re: GDK Event skipping...
- From: Tom Gilbert <gilbertt linuxbrit co uk>
- To: gtk-list gnome org
- Subject: Re: GDK Event skipping...
- Date: Thu, 17 Aug 2000 23:20:58 +0000
* Tom Gilbert (gilbertt@tomgilbert.freeserve.co.uk) wrote:
> * Tom Gilbert (gilbertt@tomgilbert.freeserve.co.uk) wrote:
> > Hey,
> > I tried something really crufty like:
> >
> > if (gdk_events_pending())
> > {
> > if ((e = gdk_event_get()) != NULL)
> > {
> > if (e->type == GDK_MOTION_NOTIFY)
> > {
> > D(5, ("skipping event, new one coming\n"));
> > event = e;
> > }
> > else
> > gdk_event_put((GdkEvent *) e);
> > }
> > }
>
> Urm. Okay, ignore the bug in my test code, I actually do it in a while()
> in my app, honest ;-) The results are the same...
Oh n/m I fixed it. For anyone else's reference:
if (gdk_events_pending())
{
while ((e = (GdkEventMotion *) gdk_event_get()) != NULL)
{
if (e->type == GDK_MOTION_NOTIFY)
{
D(5, ("skipping event, new one coming\n"));
event = e;
}
else
{
gdk_event_put((GdkEvent *) e);
break;
}
}
}
Having conclusively proved I suck, I humbly withdraw ;-) Unless anyone
has a cleaner/faster solution for me?
Tom.
--
.------------------------------------------------------.
.^. | Tom Gilbert, England | http://www.linuxbrit.co.uk |
/V\ |----------------------| gilbertt@linuxbrit.co.uk |
// \\ | Sites I recommend: `-------------------------------|
/( )\ | www.freshmeat.net www.enlightenment.org slashdot.org |
^^-^^ `------------------------------------------------------'
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]