Re: [pygtk] Highlighting all occurances of a string in a TextBuffer

2005-07-20 Thread Rich Burridge
John Finlay wrote: Looks OK to me except last line should be: start = matchEnd And I would create the tag in an initialization method. Thanks, I'll adjust accordingly. Are you sure that searchStr is in buffer? No it wasn't. In fact, nothing was in the text buffer. Here was

Re: [pygtk] Highlighting all occurances of a string in a TextBuffer

2005-07-20 Thread John Finlay
Rich Burridge wrote: Hi all, I'm trying to write a function that will highlight all occurances of the string searchStr in the TextBuffer buffer. This is what I've currently got that doesn't work. def highlightText(buffer, searchStr): buffer.create_tag("red_foreground", foreground="red"

[pygtk] Highlighting all occurances of a string in a TextBuffer

2005-07-20 Thread Rich Burridge
Hi all, I'm trying to write a function that will highlight all occurances of the string searchStr in the TextBuffer buffer. This is what I've currently got that doesn't work. def highlightText(buffer, searchStr): buffer.create_tag("red_foreground", foreground="red") start, end = buffer