Re: effective span of a TextBuffer's tag?



> From: Havoc Pennington <hp redhat com>
> Subject: Re: effective span of a TextBuffer's tag?
> Date: Wed, 7 May 2003 14:22:04 -0400
> 
> On Wed, May 07, 2003 at 12:29:01PM -0400, Yotam Medini wrote:
> > 
> > Say a tag T with attributes such as 
> >    direction=gtk.TEXT_DIR_RTL
> >    justification=gtk.JUSTIFY_RIGHT
> > was set/applied to a range R = [iter_begin, iter_end).
> > 
> > Questions
> > 
> > 1. Assuming no other tag was applied, is the text 
> >    after iter_end effected  by T?
> 
> Only for properties that apply to the entire paragraph. i.e. for some
> properties such as justification, the value for the first char of the
> paragraph is the only one that matters; values for other chars in the
> paragraph are ignored.
> 
> For properties such as color that are character-by-character, the 
> property only applies to range R.

Thanks for the explanation. 
Now, where is actually the tag information kept?
that is - what data entity holds it? 
Does each character has a priority list (possibly empty) of tags applying to it?
If a tag was applied to 
   R = [iter_begin, iter_end)
and later a text was inserted and/or deleted  before R, 
then the iterators { iter_begin, iter_end } are not valid anymore.

For example, say one wants to have a "1st character" C of a paragraph 
that will manage the 'justification-tag' T. This is be applying a tag
to a singleton range [i, i."next"()], where i points to C.
Later, when the C is removed, is T automatically removed as well?
If not, is there a clean way to "unapply" T, without removing it
from the buffer's tag-table.?

thanks -- yotam



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