tksheet icon indicating copy to clipboard operation
tksheet copied to clipboard

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

Open starling25 opened this issue 1 year ago • 1 comments

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.

starling25 avatar Feb 09 '24 15:02 starling25

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

ragardner avatar Feb 09 '24 19:02 ragardner