RE: About GtkTextBuffer and GtkTextTag



Le jeu 09/10/2003 à 13:48, martyn 2 russell bt com a écrit :
Given that my previous post generated zero reply, I'm going 
to try best
reformulate my queston.

The goal is to do basic "notepad". Its features will be bold, italic,
undeline

Actualy, user can apply texttag to text selected.

Now, I would like do that :

User selectes nothing. The insert cursor is at end of buffer, 
or between
two chars. User selectes one tag in menu. After that, when user types
char, the texttag selected will be apply to this char.

I would suggest starting by looking at the "changed" or "insert-text"
signal for the GtkTextBuffer.

When you get called back, you can then set the tag.  
When I get called back, I can't set tag because I haven't got iter start
and end of text insered because it does after the called back.


When the user changes the tag in the menu, I would say the easiest
thing to do would be to update the TAG properties.  Another approach
is to simply have GtkTextMark's in places which you want the selected
tag to be applied, and simply use gtk_text_buffer_apply_tag_by_name()
and gtk_text_buffer_remove_tag().
That is done already.




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