[Urwid] No output until keypress with web_display

Ian Ward ian at excess.org
Sat Mar 27 08:31:30 EDT 2010


Hans-Christian Esperer wrote:
> Hi,
> 
> attached is a small test program that adds one line per second to a
> list. With the raw_ display module, the screen is updated as intended.
> With the web_ and curses_ display modules however, the screen is only
> updated upon keypresses. What am I missing?

Just to repeat what I said in IRC:  curses_display.Screen and 
curses_display.Screen don't support external event loops yet (all the 
waiting is done inside get_input() instead of under control of 
MainLoop).  So in your code the watch_file callback won't get called.

I do plan on updating web_display and curses_display as I get to 
cleaning up that code.  In the meantime you can probably make it "work" 
by hacking MainLoop._run_screen_event_loop() to call draw_screen() even 
when no keys have been pressed -- web_display.Screen.get_input seems to 
be hard-coded to return after 0.5s even with no input.

Ian



More information about the Urwid mailing list