Here are a few things that might improve the above code a little. Use

gtk_button_set_focus_on_click(GTK_BUTTON(toggle1), FALSE);

instead of a grab. Also the global gboolean can be eliminated if you pass the 
toggle button pointer to the "insert-text" callback. Then you can just use

For the sequence of events it is my understanding that the text changes will be 
made during the event cycle before the window gets re-painted.




-----Original Message-----
From: Doug McCasland <>
To: cecashon <>
Sent: Tue, Jun 13, 2017 4:09 pm
Subject: Re: turn on italics in TextView

cecashon, thanks so much for your great reply!

I had tried all those calls, but I hadn't put them together as you did, nor did 
I apply the tag in the way your code does.  And I didn't think of having one 
signal/function for the button-down and another for the apply_tag_by_name.  

So your code gets a signal after the character(s) is entered. Then the style is 
applied to that char, without moving the insert point.  Do you know if the 
un-tagged char is visibly displayed first, and then altered?  Or is all the 
processing somehow finished before the display changes, and then only the 
tagged char is put on the screen.

gtk-app-devel-list mailing list

Reply via email to