[Urwid] Auto-scroll ListBox

Abhinav Singh abhinavsingh at ymail.com
Wed Jul 31 16:54:22 EDT 2013


Nevermind, with urwid==1.1.1 this can be achieved using:

abox.set_focus(len(abox.body) - 1)

Thanks,
--
Abhinav

On 31-Jul-2013, at 7:52 PM, Abhinav Singh <abhinavsingh at ymail.com> wrote:

> Hi,
> 
> Looking for auto-scroll solution on list boxes, I came across following mail thread: http://lists.excess.org/pipermail/urwid/attachments/20100922/b79889b9/attachment.py
> 
> On similar lines here is the piece of code I m trying:
> 
> abox.body.append(urwid.Text(line['data'].strip()))
> abox.set_focus(abox.body.focus + 1)
> 
> This results in "No widget at position 1" error and application just exits.
> 
> If I comment out the 2nd line of code (i.e. line where I do set_focus), application continues to work and list boxes continue to update. However, they don't scroll to the bottom.
> 
> Can someone point me to what am I doing wrong here?
> 
> PS: I m using urwid==1.1.1
> 
> Thanks,
> --
> Abhinav
> _______________________________________________
> Urwid mailing list
> Urwid at lists.excess.org
> http://lists.excess.org/mailman/listinfo/urwid

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.excess.org/pipermail/urwid/attachments/20130801/36cac1f5/attachment.htm 


More information about the Urwid mailing list