LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-12-2006, 08:35 AM   #1
gepo
LQ Newbie
 
Registered: May 2005
Posts: 6

Rep: Reputation: 0
gtk+:how to realize highlighting


i create a GtkText widget,then i wang to realize highlighting,for example:i input"if i were a bird,then i can fly!",when i input "if"then forecolor changed ,then the following "i were a bird" still kept original color.when inputting "then" ,the color changed again,how can i do it?


thank you

regards
 
Old 03-13-2006, 12:26 PM   #2
thandermax
Member
 
Registered: Jun 2005
Distribution: OpenSUSE 10.3 , 11.2 , Solaris 10, Ubuntu 9.10
Posts: 84

Rep: Reputation: 16
Post

Grab the "changed" signal of the text widget as

gtk_signal_connect(GTK_OBJECT(Widget_name),"changed",GTK_SIGNAL_FUNC(func),NULL);

void func(GtkText *obj,gpointer param_data)
{
char *text;

text = gtk_editable_get_chars(obj,0,-1);

//code to process the changed text.
// highligting code have to be managed by you.
//"text" will contain the modified text .
}
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to realize automount(direct) guduke Linux - Enterprise 1 10-24-2005 04:52 AM
Linux slow to realize connection is back up wytiger Linux - Networking 0 09-28-2004 06:36 PM
*Sigh* Didn't realize so many things would change while I was gone ;) DarkSizzle Slackware 1 09-06-2004 05:05 PM
who realize debian MiniCD! muyu Debian 1 04-07-2004 07:29 AM
fedora couldn't realize my c, d drive gobi Fedora 4 01-18-2004 06:24 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration