RE: About GtkTextBuffer and GtkTextTag

> 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 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().


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