Closed Archern4r closed 1 year ago
Hello, I am not sure if this is the problem but try using
check_function=self.checkbox_clicking)
in other words remove the brackets from self.checkbox_clicking
Two things:
1.) As Ragardener mentioned you need to pass the function object to the check_function param, by putting the brackets on it you are instantiating the function and passing the return value to it instead. i.e., change:
check_function=self.checkbox_clicking()
to
check_function=self.checkbox_clicking
2.) The checkbutton will try to parse some information about the button that has been clicked, the value and the row/column index to the argument. This will cause an error because your function only takes one arguement. Try changing it to...
def checkbox_clicking(self, data):
messagebox.showinfo("Info", f"row: {data[0]}, col: {data[1]}, event: {data[2]}, value: {data[3]}")
... so that you can see what this data looks like.
In summary, there is no bug here. I think this issue can be closed @ragardner
Alright, thank you both very much. A rather easy solve for my problem.
I would suggest to include the point by CalJaDav into the documentation though, as without his 2nd point I would have been doomed to trial and error I guess.
Thanks for the help and thanks for the library.
I agree about the documentation, thanks will update @Archern4r
Hi there,
when implementing checkboxes in tksheet I encountered it tries to execute the function stated in the "check_function"-keyword upon drawing the table but not when actually clicking the checkbox. I tried a few things to circumvent this but ultimately, this seems to be a bug to me.
For recreation, I included an example of how I encountered the bug. It's pretty ugly but it should do the trick. I use python 3.11, tksheet 5.5.0.