On Mon, Oct 6, 2008 at 11:48 PM, Ian Ward <[EMAIL PROTECTED]> wrote:
>
> I don't use threads in my applications, but I might be able to help.
> Would you post a simple program that demonstrates the problem?
>
> Ian

Hello Ian

Small example:

import time
import threading
import urwid.curses_display
import urwid

class Screen(threading.Thread):
    def run(self):
        self.ui = urwid.curses_display.Screen()
        self.ui.run_wrapper(self._run)

    def _run(self):
        size = self.ui.get_cols_rows()
        txt = urwid.Text("TEST", align="center")
        fill = urwid.Filler(txt)
        canvas = fill.render(size)
        self.ui.draw_screen(size, canvas)

        while True:
            input_list = self.ui.get_input()
            if input_list and input_list[0] == 'window resize':
                size = self.ui.get_cols_rows()
                canvas = fill.render(size)
                self.ui.draw_screen(size, canvas)

t = Screen()
t.start()
time.sleep(2000000)
raise Exception("Why?")


Exception is raised when i resize my xterm window. For some reason
this action breaks time.sleep.

Maybe there is there another way to "catch input" from another thread
/ process / whatever. Isn't it?

Thank you!
M.


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

Reply via email to