I have some tabular data, that I want displayed in my GUI. I am using PySimpleGUI.
I am building on this answer.
[sg.Table(values=data_values, headings=data_headings,
max_col_width=65,
col_widths=data_cols_width,
auto_size_columns=False,
select_mode=sg.TABLE_SELECT_MODE_BROWSE,
justification='left',
enable_events=True,
num_rows=6, key='_tracker_')]
The table has enabled events, hence every click on it creates a event with the key value.
while True:
event, values = window.read()
if event == "_tracker_":
print(values["_tracker_"])
I can obtain the row of the click with values["_tracker_"]
. Can I get the column as well?
Basically I want the event to be triggered only when the table is clicked in a specific column, while the row of the event is variable. Hence, I thought the best way was to check events on whole table and than filter out based on row and column.
If there is a completely other way to do this, I am open to suggestions.