pango.AttrIterator — an object pointing to a location in a pango.AttrList
.
class pango.AttrIterator: |
The pango.AttrIterator
object contains a pointer into a pango.AttrList
.
A pango.AttrIterator
object is created using the pango.AttrList.get_iterator
()
method and then can be advanced through the attribute changes in the text
using the next
()
method. The pango.AttrIterator
object can access information about the current attributes applied at the
iterator location (using the get
()
method) and the range of text that the current attribute change applies to
(using the range
()
method).
The pango.AttrIterator
object is only valid as long as the associated pango.AttrList
is not changed.
def copy()
Returns : | a new pango.AttrIterator
object |
The copy
() method returns a new pango.AttrIterator
object that is a copy of this attribute iterator.
def range()
Returns : | a 2-tuple containing the start and end index of the current attribute in the text. |
The range
() method returns a 2-tuple
containing the start and end index of the application of the current
attribute change in the text.
def next()
Returns : | False if the iterator is at
the end of the pango.AttrList . |
The next
() method advances the iterator
to the next attribute change in its pango.AttrList
.
The next
method returns False
if
the iterator is at the end of the pango.AttrList
;
otherwise, True
.
def get(type
)
| the pango.Attribute
type to find. |
Returns : | the pango.Attribute
matching type or None . |
The get
() method returns the pango.Attribute
at the iterator location that matches the specified
type
. When multiple attributes of the same type
overlap, the attribute whose range starts closest to the current location is
returned. If no attribute matches, None
is
returned.
def get_font()
Returns : | a 3-tuple containing a pango.FontDescription ,
a pango.Language
and a list of non-font pango.Attribute
objects at the current iterator location. |
The get_font
() method returns a 3-tuple
containing a pango.FontDescription
holding the current font attributes, a pango.Language
object (if a language is set) or None
and a list of
non-font pango.Attribute
objects in effect at the current iterator location.
def get_attrs()
Returns : | a tuple containing the pango.Attribute
objects in effect at the current iterator
location. |
This method is available in PyGTK 2.4 and above.
The get_attrs
() method returns a tuple
containing the pango.Attribute
objects in effect at the current iterator location.