wxTextAttr(3erl)
π NAME π
Okay bestie, this is wxTextAttr(3erl) β the Erlang manual page for the wxTextAttr class. The official NAME vibe is wxTextAttr - Functions for wxTextAttr class. That's the whole intro, and honestly? Iconic. β¨
πΈ DESCRIPTION πΈ
wxTextAttr is literally the character and paragraph attributes (aka the style) for a range of text in a wxTextCtrl or wxRichTextCtrl (not implemented in wx).
When you're setting up a wxTextAttr object, you pass a bitlist mask to setFlags/2 to say which style elements should be changed. Convenience era: when you call a setter such as SetFont, the relevant bit gets set for you. No cap. π«Ά
See: wxTextCtrl, wxRichTextCtrl (not implemented in wx).
wxWidgets docs: wxTextAttr.
π¦ DATA TYPES π¦
wxTextAttr()=wx:wx_object()β that's the type, bestie. π
π₯ EXPORTS π₯
new() -> wxTextAttr()β Constructors. The zero-arg constructor is here to start the party. πnew(ColText) -> wxTextAttr()β constructor that takesColText.new(Attr) -> wxTextAttr()β Types:Attr = wxTextAttr(). Constructor overload that takes an existingwxTextAttr().new(ColText, Options :: [Option]) -> wxTextAttr()β Types:ColText = wx:wx_colour();Option = {colBack, wx:wx_colour()} | {font, wxFont:wxFont()} | {alignment, wx:wx_enum()}.getAlignment(This) -> wx:wx_enum()β Types:This = wxTextAttr(). Returns the alignment flags. See?wxTextAttrAlignmentfor a list of available styles.getBackgroundColour(This) -> wx:wx_colour4()β Types:This = wxTextAttr(). Returns the background colour.getFont(This) -> wxFont:wxFont()β Types:This = wxTextAttr(). Creates and returns a font specified by the font attributes in thewxTextAttrobject. Note thatwxTextAttrdoes not store awxFontobject, so this is only a temporary font. For greater efficiency, access the font attributes directly.getFontEncoding(This) -> wx:wx_enum()β Types:This = wxTextAttr(). Returns the font encoding.getFontFaceName(This) -> unicode:charlist()β Types:This = wxTextAttr(). Returns the font face name.getFontSize(This) -> integer()β Types:This = wxTextAttr(). Returns the font size in points.getFontStyle(This) -> wx:wx_enum()β Types:This = wxTextAttr(). Returns the font style.getFontUnderlined(This) -> boolean()β Types:This = wxTextAttr(). Returnstrueif the font is underlined.getFontWeight(This) -> wx:wx_enum()β Types:This = wxTextAttr(). Returns the font weight.getLeftIndent(This) -> integer()β Types:This = wxTextAttr(). Returns the left indent in tenths of a millimetre.getLeftSubIndent(This) -> integer()β Types:This = wxTextAttr(). Returns the left sub-indent in tenths of a millimetre.getRightIndent(This) -> integer()β Types:This = wxTextAttr(). Returns the right indent in tenths of a millimeter.getTabs(This) -> [integer()]β Types:This = wxTextAttr(). Returns an array of tab stops, each expressed in tenths of a millimeter. Each stop is measured from the left margin and therefore each value must be larger than the last.getTextColour(This) -> wx:wx_colour4()β Types:This = wxTextAttr(). Returns the text foreground colour.hasBackgroundColour(This) -> boolean()β Types:This = wxTextAttr(). Returnstrueif the attribute object specifies a background colour.hasFont(This) -> boolean()β Types:This = wxTextAttr(). Returnstrueif the attribute object specifies any font attributes.hasTextColour(This) -> boolean()β Types:This = wxTextAttr(). Returnstrueif the attribute object specifies a text foreground colour.getFlags(This) -> integer()β Types:This = wxTextAttr(). Returns flags indicating which attributes are applicable. SeesetFlags/2for a list of available flags.isDefault(This) -> boolean()β Types:This = wxTextAttr(). Returnsfalseif we have any attributes set,trueotherwise. Yes, it's that exact energy: anything set means not default. πsetAlignment(This, Alignment) -> okβ Types:This = wxTextAttr();Alignment = wx:wx_enum(). Sets the paragraph alignment. See?wxTextAttrAlignmentenumeration values. Of these,wxTEXT_ALIGNMENT_JUSTIFIEDis unimplemented. In future justification may be supported when printing or previewing, only.setBackgroundColour(This, ColBack) -> okβ Types:This = wxTextAttr();ColBack = wx:wx_colour(). Sets the background colour.setFlags(This, Flags) -> okβ Types:This = wxTextAttr();Flags = integer(). Sets the flags determining which styles are being specified. The?wxTextAttrFlagsvalues can be passed in a bitlist.setFont(This, Font) -> okβ Types:This = wxTextAttr();Font = wxFont:wxFont(). This is the overload that just takesFont.setFont(This, Font, Options :: [Option]) -> okβ Types:This = wxTextAttr();Font = wxFont:wxFont();Option = {flags, integer()}. Sets the attributes for the given font. Note thatwxTextAttrdoes not store an actualwxFontobject.setFontEncoding(This, Encoding) -> okβ Types:This = wxTextAttr();Encoding = wx:wx_enum(). Sets the font encoding.setFontFaceName(This, FaceName) -> okβ Types:This = wxTextAttr();FaceName = unicode:chardata(). Sets the font face name.setFontFamily(This, Family) -> okβ Types:This = wxTextAttr();Family = wx:wx_enum(). Sets the font family.setFontSize(This, PointSize) -> okβ Types:This = wxTextAttr();PointSize = integer(). Sets the font size in points.setFontPointSize(This, PointSize) -> okβ Types:This = wxTextAttr();PointSize = integer(). Sets the font size in points.setFontPixelSize(This, PixelSize) -> okβ Types:This = wxTextAttr();PixelSize = integer(). Sets the font size in pixels.setFontStyle(This, FontStyle) -> okβ Types:This = wxTextAttr();FontStyle = wx:wx_enum(). Sets the font style (normal, italic or slanted).setFontUnderlined(This, Underlined) -> okβ Types:This = wxTextAttr();Underlined = boolean(). Sets the font underlining (solid line, text colour).setFontWeight(This, FontWeight) -> okβ Types:This = wxTextAttr();FontWeight = wx:wx_enum(). Sets the font weight.setLeftIndent(This, Indent) -> okβ Types:This = wxTextAttr();Indent = integer(). One-arg left indent setter.setLeftIndent(This, Indent, Options :: [Option]) -> okβ Types:This = wxTextAttr();Indent = integer();Option = {subIndent, integer()}. Sets the left indent and left subindent in tenths of a millimetre. The sub-indent is an offset from the left of the paragraph, and is used for all but the first line in a paragraph. A positive value will cause the first line to appear to the left of the subsequent lines, and a negative value will cause the first line to be indented relative to the subsequent lines.wxRichTextBuffer(not implemented in wx) uses indentation to render a bulleted item. The left indent is the distance between the margin and the bullet. The content of the paragraph, including the first line, starts atleftMargin + leftSubIndent. So the distance between the left edge of the bullet and the left of the actual paragraph isleftSubIndent.setRightIndent(This, Indent) -> okβ Types:This = wxTextAttr();Indent = integer(). Sets the right indent in tenths of a millimetre.setTabs(This, Tabs) -> okβ Types:This = wxTextAttr();Tabs = [integer()]. Sets the tab stops, expressed in tenths of a millimetre. Each stop is measured from the left margin and therefore each value must be larger than the last.setTextColour(This, ColText) -> okβ Types:This = wxTextAttr();ColText = wx:wx_colour(). Sets the text foreground colour.destroy(This :: wxTextAttr()) -> okβ Destroys the object. Bye bestie! π
π Cute sign-off: this iconic page comes from the wxWidgets team, version wx 2.2.2.1, manual tag wxTextAttr(3erl). Mwah! π
π¦ where this page comes from
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms