Hello! ft2010 wrote on 2011-04-09 12:53: > Hi, I'm new to Urwid (and Python too). I started a python-urwid program to > essentially display items in two listBox objects as the body in an > urwid.Frame (the layout is similar to most of IDEs). To have more control in > listboxes I created a control to display a multicolumn listbox with an > optional column's header (and in the future with optional horizontal and > vertical scrollbars). > > The new listbox is a urwid.Filler that wrap a simple urwid.ListBox with > urwid.SimpleListWalker with items implemented as urwid.Text widgets, so the > listbox is really a simple urwid listbox. If the option 'header_visible' is > true the widget will be a urwid.Filler that wrap a urwid.Pile with an > urwid.Text for listbox header in the first row and the previos widgets on > the second row. > > Now, to calculate column widths (configurable) I need to know the width of > the whole implemented widget (Filler) or at least the width of the contained > ListBox. This will help in calculating the horizontal scrollbar (if I will > implement it). For the vertical scrollbar I will need the height of the > Filler.
Have you read the "widgets in Urwid typically have no size" part of the manual? http://excess.org/urwid/wiki/WidgetMethods#WidgetMethods You know the size of a widget only when it's being rendered or handling a keyboard or mouse event. Does that not work in your case? I've had a plan for an Urwid-way to implement scrollbars for a number of years, but I haven't wanted scroll bars enough to actually implement them yet. You could have a look at what I was planning here: http://excess.org/urwid/wiki/MoreWidgets Ian _______________________________________________ Urwid mailing list [email protected] http://lists.excess.org/mailman/listinfo/urwid
