|
From: Nigel N. <nn...@gm...> - 2008-07-15 23:36:28
|
On (8 May 2007 ??) 16 July 2008 Hans-Bernhard Bröker wrote:
> > 3rd solution = use one thread only (the most ambitious)
> > - the one and only thread is an event loop.
> > - "a char arrived on stdin" is handled as an event (this is natural,
> > isn't it?), and passed to readline
> > - the event loop is actually the GUI loop, just extended to watch stdin
> > in addition to window events
>
> That's pretty much the way the Windows native terminal has been doing
> things since day 1 (and in a pretty nasty way, too, overriding the
> <stdio.h> functions with macros of our own making). Which means a bit
> of synergy might be achievable if you go this way.
>
> > Currently, we have:
> > while( readline(); do_line(); ) {};
> >
> > Instead we would have an event loop, with the following callbacks:
> > data_is_available_in_stdin() {rl_callback_read_char ();}
> > line_is_completed() {do_line();}
>
> Not necessarily. It's possible to lace the GUI event handling into the
> readline character input function instead.
Agreed. Our wx clone of HBB's Win32 version worked well.
May be... time has come to polish and submit?
Nigel
|