From 7e904dca15d5d8d23a728904fa60f69dd1bc7a0e Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 26 Oct 2018 13:24:26 -0700 Subject: [PATCH] Ensure colours set in TreeItemAttr are instances of wx.Colour --- CHANGES.rst | 4 ++++ wx/lib/agw/customtreectrl.py | 6 +++--- wx/lib/agw/hypertreelist.py | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 18ae7048..c47d5729 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -126,6 +126,10 @@ Changes in this release include the following: * Performance update for `wx.lib.agw.customtreectrl` (#1049) +* Ensure that colours set in wx.lib.agw.customtreectrl.TreeItemAttr are + instances of wx.Colour. (#1032) + + 4.0.3 "The show must go on. (Die show-stoppers! Die!)" diff --git a/wx/lib/agw/customtreectrl.py b/wx/lib/agw/customtreectrl.py index 70a356fb..94f13b81 100644 --- a/wx/lib/agw/customtreectrl.py +++ b/wx/lib/agw/customtreectrl.py @@ -857,7 +857,7 @@ class TreeItemAttr(object): :param `colText`: an instance of :class:`wx.Colour`. """ - self._colText = colText + self._colText = wx.Colour(colText) def SetBackgroundColour(self, colBack): @@ -867,7 +867,7 @@ class TreeItemAttr(object): :param `colBack`: an instance of :class:`wx.Colour`. """ - self._colBack = colBack + self._colBack = wx.Colour(colBack) def SetBorderColour(self, colBorder): @@ -879,7 +879,7 @@ class TreeItemAttr(object): .. versionadded:: 0.9.6 """ - self._colBorder = colBorder + self._colBorder = wx.Colour(colBorder) def SetFont(self, font): diff --git a/wx/lib/agw/hypertreelist.py b/wx/lib/agw/hypertreelist.py index ce008d11..7ce30988 100644 --- a/wx/lib/agw/hypertreelist.py +++ b/wx/lib/agw/hypertreelist.py @@ -2366,7 +2366,7 @@ class TreeListMainWindow(CustomTreeCtrl): # operations # ---------------------------------------------------------------------------- - def DoInsertItem(self, parent, previous, text, ct_type=0, wnd=None, image=-1, selImage=-1, data=None, separator=False): + def DoInsertItem(self, parent, previous, text, ct_type=0, wnd=None, image=-1, selImage=-1, data=None, *ignored_args): """ Actually inserts an item in the tree. @@ -2383,7 +2383,7 @@ class TreeListMainWindow(CustomTreeCtrl): use for the item in selected state; if `image` > -1 and `selImage` is -1, the same image is used for both selected and unselected items; :param `data`: associate the given Python object `data` with the item. - :param `separator`: unused at the moment, this parameter is present to comply with + :param `ignored_args`: unused at the moment, this parameter is present to comply with :meth:`CustomTreeCtrl.DoInsertItem() ` changed API. """