Help with text editing!

jinal jhaveri jhaveri at usc.edu
Fri Apr 11 03:59:51 EDT 2003


Dear All


I have written following code for the file open wizard of my editor

which sets the text.
where text arg is one read from a file.


 def setAllText(self,text):
                self.text.delete('1.0',END)
                self.text.insert(END,text)
                self.text.mark_set(INSERT,'1.0')
                self.text.see(INSERT)

Now I want two things to be donw

1) I want to display this text such that alternate rows have same color and alternate columns have same color

for eg. 
assume columsn are alternatively in blue and green.

BGBGBGBGBGBGBGBGBGBGBGBGBGBGBGBGBGBGBGB (ASSUMING THIS IS BLACK)
WGWGWGWGWGWGWGWGWGWGWGWGWGWGWGWGWGWGWGW (ASSUMING THIS IS WHITE)

Can anyone give me an idea how do I modify this text to do that?

2) Instead of allowing the edit for the whole text I have entered, I want editing possible only line per line basis.
for eg. 

name1 JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ
name2 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
name3 KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK

so when I select this text , it should allow me to edit only the line  (only line not even name1,name2 etc) on which I do double click and it shouldn't allow me to edit the whole text.


I will highly appreciate if someone can give me hints on how to go about






More information about the Python-list mailing list