[Urwid] multiple edit fields

Eric S. Johansson esj at harvee.org
Fri Jun 23 22:41:30 EDT 2006


Ian Ward wrote:
> Eric S. Johansson wrote:
>> Ian Ward wrote:
>>> The tour example just creates a bunch of widgets and puts them in a 
>>> ListBox.  What you need to do is create your Edit widgets first, keep 
>>> a variable to reference them, then add them to the ListBox.  That way 
>>> you can use your variables and set_edit_text() to change what they 
>>> are displaying.
>>
>> okay, displaying my cluelessness (i.e. a cut-and-paste monkey), you 
>> mean something like this?
> 
> A better example is section 2 "Conversation Example" in the tutorial. 
> Look at how they keep a reference to the edit widget so they can operate 
> on it later. 2.3 and 2.4 in the tutorial show how this is done with a 
> ListBox.

they sort of make sense.  I don't think I've quite learned enough.  I'm 
currently fighting with trying to make my changes visible.  It seems 
like not everything is getting invoked in the right way at the right 
time.  hopefully it will make more sense in the later morning rather 
than at 1 a.m. (note: shortly after I wrote this message, I discovered 
hda1 on my mail server was toast)

>> from your description, it sounds like I should be inserting the 
>> results of urwid.Edit into a list so they would be available to 
>> retrieve the change data from.  there's a bunch of things that I don't 
>> understand in the code, I just know it works.  For example why is the 
>> AttrWrap necessary?  If I skip that out, I'm told that urwid.Edit has 
>> no __call__ method.
> 
> Really?  That shouldn't happen.  Can you post an example program that 
> raises that exception when you remove an AttrWrap?

if I can find a small example after I get this project done.

---eric

-- 
Speech-recognition in use.  It makes mistakes, I correct some.




More information about the Urwid mailing list