[Urwid] Strange characters

Ian Ward ian at excess.org
Sun Jul 15 12:49:42 EDT 2012


On Jul 15, 2012 10:58 AM, "Uri Goren" <goren.uri at gmail.com> wrote:
>
> Hi,
> I built a simple GUI which, after the user presses "OK", runs some
commands and
> exits.
> When I use the keyboard, everything is fine.
> When I use the mouse, after my program exits, I see three characters
> in my command prompt, as if I have typed them.

That's the mouse release event being sent by your terminal, but urwid has
already exited so your shell is echoing it back.

One fix would be to activate buttons on mouse release instead of press.
That's tricky though because release events usually don't include which
button was released, and how should a click outside a button with a release
inside the (or vice versa) be handled?

Another option might be to wait briefly before exiting when the button is
clicked with MainLoop.set_alarm_in but that's not perfect either.

Ian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.excess.org/pipermail/urwid/attachments/20120715/d0f10d65/attachment.htm 


More information about the Urwid mailing list