Re: custom event loop




<aqy6633@acf5.nyu.edu>(Alex Yukhimets) writes:

> Hi.
> 
> I am sorry is this is something very basic, but I am just wondering about
> the best way (if any) to implement custom event-dispatching loop.
> 
> This is an example I used in my Motif code:
> 
> void process_events(){
>   XEvent e;
>   XmUpdateDisplay(toplevel);
>   while(XEventsQueued(XtDisplay(toplevel),QueuedAfterFlush)){
>     XNextEvent(XtDisplay(toplevel),&e);
>     XtDispatchEvent(&e);
>   }
> }

void process_events() 
{
  while (gtk_events_pending())
    gtk_main_iteration ();
}

Will do something quite similar.

Regards,
                                        Owen

 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]