Hello g, g h wrote on 2011-07-01 15:51: > Is it possible to get a field to dynamically update on every render > call? I'm trying to get a "status panel" which will display arbitrary > information that my update frequently (network statistics, for > example)
render() is generally called only when a widget is on the screen and its content is marked as having changed. So, it doesn't really fit the model you want. > Or do I need to make a separate thread in Python and call set_text() > in that thread? Is urwid thread safe? No, Urwid is not designed to have widgets updated from one thread and drawn from another. it might be safe if the widget's size doesn't change, but I'm not sure. You would have to add your own locking or communication between threads, like a pipe and use event_loop.watch_file to add a callback. The easy method for what you want is to call loop.set_alarm_in(1, update_my_dynamic_fields), where update_my_dynamic_fields is a function you define. Ian _______________________________________________ Urwid mailing list [email protected] http://lists.excess.org/mailman/listinfo/urwid
