GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Nov 27, 2014 1:38 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Position of a highlighted string???
PostPosted: Mon Feb 11, 2008 12:34 pm 
Offline
Familiar Face

Joined: Mon Feb 11, 2008 12:28 pm
Posts: 15
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 :)


Top
 Profile  
 
 Post subject: Position of a highlighted string???
PostPosted: Thu Feb 14, 2008 3:28 am 
Offline
Familiar Face

Joined: Wed Oct 03, 2007 12:28 pm
Posts: 25
Location: Virginia (Northern)
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google Adsense [Bot] and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group