ragardner / tksheet

Python tkinter table widget for displaying tabular data
https://pypi.org/project/tksheet/
MIT License
408 stars 50 forks source link

How to Check if a Check Box is checked in tksheet 7 #211

Open starling25 opened 9 months ago

starling25 commented 9 months ago

I could do this in tksheet 6 like: cb = sheet.checkbox(0, 0, checked = None, state = None, check_function = "", text = None) if cb['checked'] == True: print('checked')

But this does not work anymore.

ragardner commented 9 months ago

Hello,

Sorry, yea, I realize now I haven't provided a replacement function nor have I explained it very well in the changelog or documentation

In the short term you can get the cell data which should be either True or False by using

cb = sheet[0, 0].data
if cb:
    print('checked')

The first 0 is the row, the second is the column

In the longer term I will think how best to add a function to get a checkbox dict to version 7