"Ian Ward" <[email protected]> ha scritto nel messaggio 
news:[email protected]...
> 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
>

ehm, I readed it but forget it when I started coding...

> 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

Probably my approach to this library is wrong, I have to understand the 
internals to know if I can use it like other libraries (TVision in C++, to 
mention one or a low level ncurses wrap). Urwid is good if used for web 
browser like display, it has a very good unicode support and color 
management.
Perhaps there is a way to use it to develop an UI to manage widgets 
(controls), like in a GUI, by re-implementing all high level widgets as box 
widgets (they should have a method to ask their size), I will try this path, 
if it works I will tell you my progress.

Thanks for your answer




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

Reply via email to