Pango.TabArray

Fields

None

Methods

class new (initial_size, positions_in_pixels)
  copy ()
  free ()
  get_positions_in_pixels ()
  get_size ()
  get_tab (tab_index)
  get_tabs ()
  resize (new_size)
  set_tab (tab_index, alignment, location)

Details

class Pango.TabArray

A Pango.TabArray struct contains an array of tab stops. Each tab stop has an alignment and a position.

classmethod new(initial_size, positions_in_pixels)[source]
Parameters:
  • initial_size (int) – Initial number of tab stops to allocate, can be 0
  • positions_in_pixels (bool) – whether positions are in pixel units
Returns:

the newly allocated Pango.TabArray, which should be freed with Pango.TabArray.free().

Return type:

Pango.TabArray

Creates an array of initial_size tab stops. Tab stops are specified in pixel units if positions_in_pixels is True, otherwise in Pango units. All stops are initially at position 0.

copy()[source]
Returns:the newly allocated Pango.TabArray, which should be freed with Pango.TabArray.free().
Return type:Pango.TabArray

Copies a Pango.TabArray

free()[source]

Frees a tab array and associated resources.

get_positions_in_pixels()[source]
Returns:whether positions are in pixels.
Return type:bool

Returns True if the tab positions are in pixels, False if they are in Pango units.

get_size()[source]
Returns:the number of tab stops in the array.
Return type:int

Gets the number of tab stops in self.

get_tab(tab_index)[source]
Parameters:tab_index (int) – tab stop index
Returns:
alignment:location to store alignment, or None
location:location to store tab position, or None
Return type:(alignment: Pango.TabAlign, location: int)

Gets the alignment and position of a tab stop.

get_tabs()[source]
Returns:
alignments:location to store an array of tab stop alignments, or None
locations:location to store an array of tab positions, or None
Return type:(alignments: Pango.TabAlign, locations: [int])

If non-None, alignments and locations are filled with allocated arrays of length Pango.TabArray.get_size(). You must free the returned array.

resize(new_size)[source]
Parameters:new_size (int) – new size of the array

Resizes a tab array. You must subsequently initialize any tabs that were added as a result of growing the array.

set_tab(tab_index, alignment, location)[source]
Parameters:
  • tab_index (int) – the index of a tab stop
  • alignment (Pango.TabAlign) – tab alignment
  • location (int) – tab location in Pango units

Sets the alignment and location of a tab stop. alignment must always be Pango.TabAlign.LEFT in the current implementation.