Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
starling25 opened this issue Feb 9, 2024 · 1 comment
Open

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

starling25 opened this issue Feb 9, 2024 · 1 comment

Comments

@starling25
Copy link

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
Copy link
Owner

ragardner commented Feb 9, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants