Hey list,I don't think that that mode of operation matches the tag model of the TextBuffer i.e. tags have to span a range of text with one or more characters. Being able to place the cursor somewhere and indicate that a tag begins and ends there, seems outside the concepts of a TextBuffer to handle automatically. That said I suspect you could get close to what you want though with a lot of bookkeeping, etc. by connecting to the "begin-user-action", "insert-text" and "end-user-action" signals that are emitted when text is being entered by a user. Use "begin-user-action" to initialize the state; "insert-text" to get the iter, and text length; and, "end-user-action" to clear existing tags and apply the desired tag(s) to the inserted text.
After looking through many tutorials and examples of the gtk.TextView
and gtk.TextBuffer widgets, I now know how to insert blocks of text here
and there with various tags applied. I still do not know how to make a
simple toggle button for 'bold' work. I would like to implement very
simple text formatting into my app, but I'm not sure what the best way
to do it is.
How does one apply tags to text as it is being entered into the
TextBuffer via the keyboard?
John
_______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
