Making the event loop run normally



Hi,

Yet another question for the Gtk gurus out there.

In R, the front end calls an eval() function, passing it an
expression to evaluate.  This expression may call R_ReadConsole,
which (in the text mode version) just read()s from the tty.

In the gtk interface, I want to read from a subclass of a text
widget.  The problem I have is how to ensure that events get
processed while this happens.

One way to do it would be to:
while(gtk_events_pending())
    gtk_main_iteration();
or whatever it is.

The problem with that is that it will spin round in the loop,
using up 100% processor time, for as long as it takes the user
to type in a line.

What needs to happen is:
- R eval calls R_ReadConsole
- R_ReadConsole enables input in my GtkConsole widget and
  connects to a signal which indicates when a line of input is
  ready.
- R_ReadConsole should somehow get the gtk event loop running,
  so that the application's interface (especially the console
  widget) keeps going.  Eventually there will be other windows
  that could (for example) accept mouse input, so I want all
  events for the application (not just the current window) to
  be processed.

Can anyone suggest a function to call from my R_ReadConsole 
function that will just drop into the gtk event loop?  

Thanks,
Lyndon



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