The app is a canvas-based app. For a certain box on the gui, when the user clicks it, I bring up a checkbutton dialog.  The dialog contains a color coded gif image at the top. Below that are 48 checkbuttons arranged in groups of 4.  Each group of four corresponds to a color in the gif image. So I set the background color of each checkbutton to its corresponding color in the gif image.  This helps the user select the appropriate button.  The colors are just rgb strings like "#00cc00", etc.
My problem is, when I run on Linux, the background colors of the checkbuttons do not appear unless I mouse over the checkbuttons. Otherwise they just have a gray background. When I run on Windows from MobaXterm, it works like a charm.  The background colors appear immediately.  However, the target platform is Linux.
I've tried the following: Using ttk and not using ttk.  Forcing a dialog update, forcing a "do-nothing" mouse enter event.  None of this has worked though.  The python 3 version is anaconda 3.7.6 with tkinter 8.6.10.
I found a solution. For each checkbutton, I bind events Enter and Leave to a callback that does nothing, just returns. Then, after the dialog is created, I call event_generate first to Enter then to Leave the checkbutton.
This appears to solve the issue, and the dialog works correctly as well.
Though, if someone has a more elegant solution, I would like to see that as well.
Python 3 tkinter checkbutton dialog with different background colors