Re: turn on italics in TextView




 
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

if(gtk_toggle_button_get_active(user_data))
  
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.

https://developer.gnome.org/gtk3/stable/chap-drawing-model.html

Eric
 

 

 

-----Original Message-----
From: Doug McCasland <dougm bravoecho net>
To: cecashon <cecashon aol com>
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.  Cool!  


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.








[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]