|
|
| Author |
Message |
|
|
angel face Familiar Face
Joined: 11 Feb 2008 Posts: 15
|
Posted: Mon Feb 11, 2008 12:34 pm Post subject: Position of a highlighted string??? |
|
|
Hey people!
I have a problem and i hope someone can help me!
Bascially i developing a program(wont bore u with all the details) with a front end GUI . Im developing it in C and GTK. Im very much new to GTK and im not the most familiar with C!......Im much more of a Java person!
So my problem is...
After reading in a file or simply typing up a few lines of text into a GTK textbox widget i want to bascially find out how to do the following:
1) be able to highlight a specific word in the GTK textbox widget and find the position of where that word starts and ends.
I cant seem to find much helpful info online.
I hope someone can help.
Thanks :) |
|
| Back to top |
|
 |
kharrison Familiar Face
Joined: 03 Oct 2007 Posts: 25 Location: Virginia (Northern)
|
Posted: Thu Feb 14, 2008 3:28 am Post subject: Position of a highlighted string??? |
|
|
Interesting problem... I have not done this myself but offer the following ideas.
Have you looked at the following functions?
To get the text within the GtkTextView's buffer:
gtk_text_buffer_get_text ()
Then search for the substring returned from above to find your desired word...
I'm not sure of the highlight part. Perhaps:
gtk_text_buffer_select_range()
could be used for this?
Good Luck!
Kirk |
|
| Back to top |
|
 |
|