Discussion:
[Urwid] Auto-scroll ListBox
Abhinav Singh
2013-07-31 14:22:38 UTC
Permalink
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.excess.org/pipermail/urwid/attachments/20130731/069aa270/attachment.htm
Abhinav Singh
2013-07-31 20:54:22 UTC
Permalink
Nevermind, with urwid==1.1.1 this can be achieved using:

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

Thanks,
--
Abhinav
Post by Abhinav Singh
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
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
Loading...