From b976bf61f2ec7d28e68d09e0ce92c59afbd02965 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Sat, 29 Sep 2018 23:25:07 -0400 Subject: [PATCH] Fix for background and text color in Tables --- PySimpleGUI.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index 7108579a..bf41a8c5 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -3401,7 +3401,9 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form): value = [i] + value id = treeview.insert('', 'end', text=value, values=value) if element.BackgroundColor is not None and element.BackgroundColor != COLOR_SYSTEM_DEFAULT: - element.TKTreeview.configure(background=element.BackgroundColor) + ttk.Style().configure("Treeview", background=element.BackgroundColor, fieldbackground=element.BackgroundColor) + if element.TextColor is not None and element.TextColor != COLOR_SYSTEM_DEFAULT: + ttk.Style().configure("Treeview", foreground=element.TextColor) # scrollable_frame.pack(side=tk.LEFT, padx=element.Pad[0], pady=element.Pad[1], expand=True, fill='both') element.TKTreeview.pack(side=tk.LEFT,expand=True, padx=0, pady=0, fill='both') if element.Tooltip is not None: