ft2010 wrote on 2011-04-10 04:00:
> 
> "Ian Ward" <[email protected]> ha scritto nel messaggio 
> news:[email protected]...
>> 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.

You might mean fixed widgets (widgets that know their own size).

You're free to implement all your own widgets in Urwid and ignore the
ones it comes with (then you get the nice Unicode, colour handling etc.)

I started along that path (all widgets know their own size), but I ran
into a few problems:
 - what size is a widget that was just created?
 - should widgets know their parents so they can ask their size?
 - when a container changes should the sizes of the widgets it contains
be updated immediately?  (might be slow if done frequently)
 - what about off-screen widgets?  (It might be slow to update those as
well)

I'm interested to see what you come up with, and I encourage you to
leverage the parts of Urwid that you can to save time.

Ian

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

Reply via email to