RE: GtkTextView: Applying tags at the cursor




Hi, 
You can use GtkTextTag.
Tags should be in the GtkTextTagTable for a given GtkTextBuffer before using
them with that buffer. 
gtk_text_buffer_create_tag() is the best way to create tags. See gtk-demo
for numerous examples. 

Hope this helps.

Rgds,
Madhusudan E


--------------------------------------------------------------------------

Hi,

I'm working on a web site creation software that uses Gtk, Glade and
Python for the UI. I'm using the GtkTextView widget to let the user edit
text with basic formatting but I have a question:

How do I apply a tag at the cursor so that inserted text gets it's
formatting? Right now I surround the cursor with two zero-width spaces
(an invisible Unicode character) and then I apply the tag to the spaces.
This gives new text the right formatting, but it's an ugly solution that
has some bugs...

Kind regards,
Samuel Liden Borell
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list





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