pango.TabArray
Prev | The pango Class Reference | Next

## pango.TabArray

pango.TabArray — an object containing an array of tab stops.

## Synopsis

    class pango.TabArray(gobject.GBoxed):
        pango.TabArray(initial_size, positions_in_pixels)
        def copy()
        def get_size()
        def resize(new_size)
        def set_tab(tab_index, alignment, location)
        def get_tab(tab_index)
        def get_tabs()
        def get_positions_in_pixels()

## Description

A `pango.TabArray` object contains an array of tab stops. Each tab stop has an alignment and a position.

## Constructor

        pango.TabArray(initial_size, positions_in_pixels)

`initial_size` : | Initial number of tab stops to allocate, can be 0
`positions_in_pixels` : | if `True` the tab positions are in pixel units
Returns : | a `pango.TabArray`

Creates a new `pango.TabArray` object with the number of tab stops specified by `initial_size`. If `positions_in_pixels` is `True`, the tab stop positions are specified in pixel units otherwise in pango units (one pixel = `pango.SCALE` pango units). All tab stops are initially at position 0.

## Methods

### pango.TabArray.copy

        def copy()

Returns : | a new `pango.TabArray` object

The `copy`() method returns a new `pango.TabArray` that is copy of this `pango.TabArray`.

### pango.TabArray.get_size

        def get_size()

Returns : | the number of tab stops in the array.

The `get_size`() method returns the number of tab stops in the tab array.

### pango.TabArray.resize

        def resize(new_size)

`new_size` : | the new size of the array

The `resize`() method sets the size of the tab array to the value specified by `new_size`. You must subsequently initialize any tabs that were added to the array.

### pango.TabArray.set_tab

        def set_tab(tab_index, alignment, location)

`tab_index` : | the index of a tab stop
`alignment` : | the tab alignment
`location` : | the tab location in pango units

The `set_tab`() method sets the specified `alignment` and `location` of the tab stop specified by `tab_index`. The value of `alignment` must always be `pango.TAB_LEFT` in the current implementation.

### pango.TabArray.get_tab

        def get_tab(tab_index)

`tab_index` : | the tab stop index
Returns : | a 2-tuple containing the tab alignment and position

The `get_tab`() method returns a 2-tuple containing the alignment and position of the tab stop specified by `tab_index`.

### pango.TabArray.get_tabs

        def get_tabs()

Returns : | a tuple containing a list of 2-tuples (each holding the alignment and position of a tab stop).

The `get_tabs`() method returns a tuple containing a list of 2-tuples (each holding the alignment and position of a tab stop)

### pango.TabArray.get_positions_in_pixels

        def get_positions_in_pixels()

Returns : | `True` if tab stop positions are specified in pixels

The `get_positions_in_pixels`() method returns `True` if the tab positions are specified in pixels and `False` if they are in pango units.

Prev | Up | Next
pango.Renderer | Home | The Pango Markup Language