.. wxPython Phoenix documentation This file was generated by Phoenix's sphinx generator and associated tools, do not edit by hand. Copyright: (c) 2011-2020 by Total Control Software License: wxWindows License .. include:: headings.inc .. _wx.ItemAttr: ========================================================================================================================================== |phoenix_title| **wx.ItemAttr** ========================================================================================================================================== Represents the attributes (colour, font, ...) of an item of a control with multiple items such as e.g. :ref:`wx.ListCtrl`. .. versionadded:: 4.1/wxWidgets-3.1.1 (previous versions had a similar ListItemAttr class) .. seealso:: :ref:`ListCtrl Overview ` | |class_hierarchy| Class Hierarchy ================================= .. raw:: html
Inheritance diagram for class ItemAttr:
| |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~wx.ItemAttr.__init__` Default Constructor. :meth:`~wx.ItemAttr.GetBackgroundColour` Returns the currently set background colour. :meth:`~wx.ItemAttr.GetFont` Returns the currently set font. :meth:`~wx.ItemAttr.GetTextColour` Returns the currently set text colour. :meth:`~wx.ItemAttr.HasBackgroundColour` Returns ``True`` if the currently set background colour is valid. :meth:`~wx.ItemAttr.HasColours` Returns ``True`` if either text or background colour is set. :meth:`~wx.ItemAttr.HasFont` Returns ``True`` if the currently set font is valid. :meth:`~wx.ItemAttr.HasTextColour` Returns ``True`` if the currently set text colour is valid. :meth:`~wx.ItemAttr.IsDefault` Returns ``True`` if this object has no custom attributes set. :meth:`~wx.ItemAttr.SetBackgroundColour` Sets a new background colour. :meth:`~wx.ItemAttr.SetFont` Sets a new font. :meth:`~wx.ItemAttr.SetTextColour` Sets a new text colour. :meth:`~wx.ItemAttr.__ne__` Compare two item attributes for inequality. :meth:`~wx.ItemAttr.__eq__` Compare two item attributes for equality. ================================================================================ ================================================================================ | |property_summary| Properties Summary ===================================== ================================================================================ ================================================================================ :attr:`~wx.ItemAttr.BackgroundColour` See :meth:`~wx.ItemAttr.GetBackgroundColour` and :meth:`~wx.ItemAttr.SetBackgroundColour` :attr:`~wx.ItemAttr.Font` See :meth:`~wx.ItemAttr.GetFont` and :meth:`~wx.ItemAttr.SetFont` :attr:`~wx.ItemAttr.TextColour` See :meth:`~wx.ItemAttr.GetTextColour` and :meth:`~wx.ItemAttr.SetTextColour` ================================================================================ ================================================================================ | |api| Class API =============== .. class:: wx.ItemAttr(object) **Possible constructors**:: ItemAttr() ItemAttr(colText, colBack, font) Represents the attributes (colour, font, ...) of an item of a control with multiple items such as e.g. .. method:: __init__(self, *args, **kw) |overload| Overloaded Implementations: :html:`

` **__init__** `(self)` Default Constructor. :html:`

` **__init__** `(self, colText, colBack, font)` Construct a :ref:`wx.ItemAttr` with the specified foreground and background colours and font. :param `colText`: :type `colText`: wx.Colour :param `colBack`: :type `colBack`: wx.Colour :param `font`: :type `font`: wx.Font :html:`

` .. method:: GetBackgroundColour(self) Returns the currently set background colour. :rtype: :ref:`wx.Colour` .. method:: GetFont(self) Returns the currently set font. :rtype: :ref:`wx.Font` .. method:: GetTextColour(self) Returns the currently set text colour. :rtype: :ref:`wx.Colour` .. method:: HasBackgroundColour(self) Returns ``True`` if the currently set background colour is valid. :rtype: `bool` .. method:: HasColours(self) Returns ``True`` if either text or background colour is set. :rtype: `bool` .. seealso:: :meth:`HasBackgroundColour` , :meth:`HasTextColour` .. method:: HasFont(self) Returns ``True`` if the currently set font is valid. :rtype: `bool` .. method:: HasTextColour(self) Returns ``True`` if the currently set text colour is valid. :rtype: `bool` .. method:: IsDefault(self) Returns ``True`` if this object has no custom attributes set. :rtype: `bool` .. method:: SetBackgroundColour(self, colour) Sets a new background colour. :param `colour`: :type `colour`: wx.Colour .. method:: SetFont(self, font) Sets a new font. :param `font`: :type `font`: wx.Font .. method:: SetTextColour(self, colour) Sets a new text colour. :param `colour`: :type `colour`: wx.Colour .. method:: __ne__(self) Compare two item attributes for inequality. :param `other`: :type `other`: wx.ItemAttr .. method:: __eq__(self) Compare two item attributes for equality. :param `other`: :type `other`: wx.ItemAttr .. attribute:: BackgroundColour See :meth:`~wx.ItemAttr.GetBackgroundColour` and :meth:`~wx.ItemAttr.SetBackgroundColour` .. attribute:: Font See :meth:`~wx.ItemAttr.GetFont` and :meth:`~wx.ItemAttr.SetFont` .. attribute:: TextColour See :meth:`~wx.ItemAttr.GetTextColour` and :meth:`~wx.ItemAttr.SetTextColour`