GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Position of a highlighted string???

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
angel face
Familiar Face


Joined: 11 Feb 2008
Posts: 15

PostPosted: Mon Feb 11, 2008 12:34 pm    Post subject: Position of a highlighted string??? Reply with quote

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)

PostPosted: Thu Feb 14, 2008 3:28 am    Post subject: Position of a highlighted string??? Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP