RE: About GtkTextBuffer and GtkTextTag
- From: <martyn 2 russell bt com>
- To: <mailing harobed org>, <gtk-app-devel-list gnome org>, <gtk-list gnome org>
- Subject: RE: About GtkTextBuffer and GtkTextTag
- Date: Thu, 9 Oct 2003 12:48:10 +0100
> 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,
> 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().
] [Thread Prev