2

I have a gui that has a button on it with a table of values. I would like it to change the background color of table values when I press the button. Does anyone know how?

Here is my layout code:

layout: list = [
        sg.Table(
            values=[[0, 0], [0, 0], [0, 0]],
            headings=["Values", "Percent Difference"],
            size=(5, 5),
            num_rows=3,
            background_color="white",
            text_color="black",
            hide_vertical_scroll=True,
            key="_TABLE_",
        ),
        sg.SetOptions(element_background_color='#FFFFFF',
            key="_COLOR_"),
    ],
    [
        sg.Button(
            button_text="Analyze",
            tooltip="Once channels and points are selected, use this to complete Cg/Cv analysis.",
            enable_events=True,
            key="_ANALYSIS_",
        ),
    ]
Bob
  • 51
  • 4
  • 2
    Try `window.Element('_TABLE_').Update(background_color="blue")` – stovfl Nov 10 '19 at 21:04
  • Not sure you'll be able to change the background color of a table yet. I think there's a bug logged on it. It also depends on which port you're using for some features. – Mike from PSG Nov 12 '19 at 17:24

0 Answers0