[Urwid] ListBox Won't Scroll Using Keys
Ryan Ross
ryanross at ece.ucsb.edu
Mon Sep 11 16:43:42 EDT 2006
Hi All!
First of all, great library! Interfaces become much prettier much easier than
with curses.
The problem I am having is that my listbox (list of buttons) won't scroll
using the arrow keys. It can definitely get focus though, as I can use the
mouse to select the buttons (and that changes the cursor position). Below are
some relevent portions of code. Each container here is wrapping the one
before it. Also, I've attached a tar.gz of the code + the two sample data
files (hopefully it will go through).
Button Definition:
newbutton = urwid.Button(string.split(line,',')[0],on_animate_button)
newbutton = urwid.AttrWrap(newbutton, 'normtext', 'header')
allow_from_buttons.append(newbutton)
ListBox Definition:
allowfrombox = urwid.ListBox(allow_from_buttons)
Frame Definition:
allowfrom = urwid.Frame(allowfrombox, urwid.AttrWrap(urwid.Text("Allow
From"), 'listheader'))
Column Definition:
listcols = urwid.Columns([('weight',4,allowfrom),
('weight',6,allowservice)],dividechars=1,focus_column=0)
Pile Definition:
complete = urwid.Pile([('fixed', 3, top),listcols],focus_item=1)
Ryan Ross
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fire_urwid.tar.gz
Type: application/x-tgz
Size: 1218 bytes
Desc: not available
Url : http://lists.excess.org/pipermail/urwid/attachments/20060911/bf619001/fire_urwid.tar.bin
More information about the Urwid
mailing list