Jan-Philip Gehrcke wrote:
>     2) It doesn't :(
>     ================
>     I've another example code that populates the ListBox, but this time
>     with an os.pipe() (that's not interesting for now). The main
>     difference is, that I used urwid.MainLoop() here:
> 
>     http://paste.pocoo.org/show/ZoEpBjDJ8ZZDwp0DMCMX/
> 
>     Run it, see your ListBox getting populated with items and use your
>     mouse wheel after the final state is reached: does it do anything?
>     Not for me. The feature is gone :-)
> 
>     I'm interested in the reasons for this phenomenon! And I think that
>     official and always-working mousewheel support would be great in
>     general!

If you add "handle_mouse = False," to the MainLoop constructor this
example also scrolls.  Likely because your terminal is helpfully
converting mouse wheel events to key-presses when the application has
not asked for mouse events to be sent to it.

The proper way to add scroll wheel support would be adding some code to
ListBox.mouse_event to handle button press 4 and 5 events (possibly
after letting their children handle them, in case you have a scrolling
widget inside a scrolling widget).

Ian


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

Reply via email to