Retrieving a line of text from a Text Widget when clicking on it 
Author Message
 Retrieving a line of text from a Text Widget when clicking on it
Hi All,

I'm a little bit stuck and wondering if anyone can help?

I have a Text widget which I have inserted lines of text into.

I have a search procedure which goes through the lines of text in the
Text widget and finds certain strings of text as entered in an Entry
widget.

When the text is found in the Text widget, every occurrence is tagged
with a highlight and also has a binding applied (button 1 more
specifically) which links to a callback.

My problem:
Once the line is found which contains the text 'searched for' I would
like to be able to click  on the bound/high lighted  text and have the
whole line returned as a string variable which I can then use in the
callback.

Keep in mind that each line of the Text widget is unique and so I need
to be able to return only the line I click on which contains the found
text.

Does anyone have a snippet of code or can point me in the right
direction to accomplish this?

Many thanks in advance.

Regards,

Ian...



Thu, 12 May 2005 00:11:51 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Text Widget - removing right-click menu

2. Text widget double-click

3. Binding a right-click in a text widget

4. Q: Changing Text-Color in Text-Widget?

5. text formatting in a Text widget

6. How update text in text widget when executing some other callback

7. Color Coding Text in a Tk::Text Widget

8. Checking for marked or selected text in a Text widget

9. Grabbing Text from Text widget

10. Making text appear in a text widget...

11. best way to save text in Text widget

12. text in a Text widget

 

 
Powered by phpBB® Forum Software