On Tue, 2004-05-04 at 05:16, John Finlay wrote:
> >How does one apply tags to text as it is being entered into the
> >TextBuffer via the keyboard? 
> >  
> 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.

Thanks for the input John. I've been thinking about this for a while
because I just want to make my little TextView/Buffer act as a regular
word processor for _simple_ formatting. I thought that this would be a
common action, but didn't see it fitting real well with the API. I
suppose this explains why there is nothing like this in the demos :)

I'll play around with this idea for a bit. I'm not sure that it'll yeild
anything that I'll end up keeping, but we'll see.

Cheers,
~djc

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to