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)

Or do I need to make a separate thread in Python and call set_text() in that 
thread?  Is urwid thread safe?

What I have:

class ActionArea(urwid.Pile):
    txt = None
    
    def __init__(self):
        self.txt = urwid.Text(('banner', " Hello World 2 "), align='center')
        
        edit1 = urwid.Edit("field1")
        edit2 = urwid.Edit("field1")
        
        super(ActionArea,self).__init__([txt_box, edit1, edit2], focus_item=1)
        
    def render(self, size, focus=False):
        out = subprocess.Popen(['ls', '-l'], 
stdout=subprocess.PIPE).communicate()[0]
        if self.txt is not None:
            self.txt.set_text(out)
        return super(ActionArea, self).render(size,focus)


_______________________________________________
Urwid mailing list
[email protected]
http://lists.excess.org/mailman/listinfo/urwid

Reply via email to