Pango::TabArray(3)

πŸ’… Pango::TabArray β€” a Perl wrapper page, but make it cute

Okay bestie, this is from the User Contributed Perl Documentation section (manual page Pango::TabArray(3)), and it's literally just a lil' Perl wrapper situation. Let's get into it 🫢

✨ NAME ✨

Pango::TabArray β€” it's a wrapper for PangoTabArray. That's it, that's the whole vibe. Lowkey iconic for how straightforward it is.

🌸 HIERARCHY 🌸

Check the family tree, she's got lineage:

Glib::Boxed
+----Pango::TabArray

So Pango::TabArray is a Glib::Boxed girlie. Periodt.


πŸŽ€ METHODS πŸŽ€

🌟 tabarray = Pango::TabArray->new ($initial_size, $positions_in_pixels, ...)

Make a brand new one, slay. The args are:

  • $initial_size (integer)
  • $positions_in_pixels (boolean)
  • ... (list) β€” pairs of Pango::TabAlign's and integers, i.e. the alignments and positions of the tab stops. One alignment, one position, one alignment, one position, you get it 😌

🌟 tabarray = Pango::TabArray->new_with_positions ($initial_size, $positions_in_pixels, ...)

Same energy, different name. The args:

  • $initial_size (integer)
  • $positions_in_pixels (boolean)
  • ... (list) β€” pairs of Pango::TabAlign's and integers, the alignments and positions of the tab stops.
It's an alias for new. Literally the same thing. Two names, one queen πŸ‘‘

🌟 boolean = $tab_array->get_positions_in_pixels

Tells you the $positions_in_pixels situation as a boolean. No args, she just answers. ✨

🌟 $tab_array->resize ($new_size)

Resize the tab array. Args:

  • $new_size (integer)

Glow-up or shrink-down, your call πŸ’–

🌟 integer = $tab_array->get_size

Returns the size, as an integer. Chef's kiss, no notes.

🌟 list = $tab_array->get_tab ($tab_index)

Grabs one tab. Args:

  • $tab_index (integer)

Returns a list, bestie. Remember that.

🌟 $tab_array->set_tab ($tab_index, $alignment, $location)

Sets a tab. Args:

  • $tab_index (integer)
  • $alignment (Pango::TabAlign)
  • $location (integer)

🌟 list = $tab_array->get_tabs

Returns a list of Pango::TabAlign's (the alignments) and integers (the locations).

Now listen, this part matters β€” and yes the original does say "elemtents", we're not fixing it, it's part of the lore 😭 β€” the even elements are alignments and the odd elements are locations. So 0 is the first alignment, 1 is the first location, 2 is the second alignment, 3 is the second location, etc. Index math, but make it fashion πŸ’…


🌈 ENUMS AND FLAGS 🌈

enum Pango::TabAlign

The whole menu of alignments, take your pick:

  • 'left' / 'PANGO_TAB_LEFT'
  • 'right' / 'PANGO_TAB_RIGHT'
  • 'center' / 'PANGO_TAB_CENTER'
  • 'decimal' / 'PANGO_TAB_DECIMAL'

Four options, all valid, all gorgeous πŸ¦‹


πŸ‘‘ SEE ALSO πŸ‘‘

Go look at Pango and Glib::Boxed if you want the full picture. Iykyk.


Copyright (C) 2003-2011 by the gtk2-perl team. Respect the elders 🫢

This software is licensed under the LGPL. See Pango for a full notice β€” they've got the whole legal saga over there, go read it if that's your thing.


And that's the whole page!! Signing off with the receipts: this was perl v5.42.0, dated 2019-09-16 β€” vintage but still serving πŸ’œβœ¨

πŸ“¦ where this page comes from