Text widget - insert line

Steve Holden steve at holdenweb.com
Tue Nov 23 08:13:51 EST 2004


beps wrote:

> 
>>>def show_customers(self, customers) :
>>>##      data is a list
>>>        for data in customers:
>>>            dato = operator.concat(str(data), '/n')
>>
>>                                                 ^^
>>You have to use n, not /n.
> 
> 
>>Reinhold
> 
> 
> Yes, excuse me, this is my code now:
> 
>>>def show_customers(self, customers) :
>>>        #customers is a list
>>>        for data in customers :
>>>             self.text_wdgt.insert(0.0, data)
>>>             self.text_wdgt.insert(0.0, '\n')     
> 
> 
> but the following is the output :
> ---------------
> |data[last]
> |data[....]
> |data[....]
> |data[....]
> |data[first]
> |--------------
> 
> I must obtain the exact contrary :
> ---------------
> |data[first]
> |data[....]
> |data[....]
> |data[....]
> |data[last]
> |--------------
> 
> There's an error in the indices of insert() method of Text widget.
> The first data line one goes on the second and so on.
> I would have to obtain the exact index of the line end.
> But I have not still understood and tried like making.
> 
> If you have a ready example you show it to me, please.
> thanks for all
> 

This is happening because you are telling the widget to insert the new 
items at the start (0.0). If you replace this with END instead it should 
work as you want.

regards
  Steve

-- 
http://www.holdenweb.com
http://pydish.holdenweb.com
Holden Web LLC +1 800 494 3119



More information about the Python-list mailing list