Re: effective span of a TextBuffer's tag?

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.

> 2. If a text is inserted in the middle of  [iter_begin, iter_end)
>    is it effected by the tag ?


> 3. When a text containing R is extracted and inserted (copy and paste) 
>    elsewhere, does it carry any of T's attributes ?

It does if the copy and paste is from one text buffer to another, in
the same process, sharing the same tag table. Currently attributes are
not preserved across processes. (Because you'd have to implement some
means of serializing the attributes, and figure out how to identify
two tag tables in different processes as "the same".)


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