You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Ragardner,
I try to move from v5.3.2 to v5.4.0 but with recent changes this is not working for checkbox anymore for my application.
In fact it is because I wanted to put some checkbox with some values which are not boolean True/False or 0/1
(I found a dirty way of doing it with v5.3.2 but that will be better to have a tksheet way of doing it)
I build a proposal with a definition of onvalue and offvalue (defined in cell_option) instead editing the cell value itself like:
self.cell_options[(r, c)]['checkbox'] = {'check_function': check_function,
'state': state,
'checked': checked,
'onvalue': onvalue,
'offvalue': offvalue,
'text': text}
Hi,
The on / off value indicate what is the data value in a column sheet data representing true for the checkbox or which value represent false for the checkbox.
Then when clicking on the checkbox the data is set in the cell sheet data by those values.
Example for checkbox on column 1:
self.data_header = ["val1", "val2"]
self.data = [
["this_is_true", "AAA1"],
["", "BBBB1" ],
["this_is_false", "CCCCC1"],
]
# the creation could be like that
checked = True if value == "this_is_true" else False
self.sheet.create_checkbox(row, col, checked=checked, onvalue="this_is_true", offvalue="this_is_false", redraw=True)
Hi Ragardner,
I try to move from v5.3.2 to v5.4.0 but with recent changes this is not working for checkbox anymore for my application.
In fact it is because I wanted to put some checkbox with some values which are not boolean True/False or 0/1
(I found a dirty way of doing it with v5.3.2 but that will be better to have a tksheet way of doing it)
I build a proposal with a definition of onvalue and offvalue (defined in cell_option) instead editing the cell value itself like:
self.cell_options[(r, c)]['checkbox'] = {'check_function': check_function,
'state': state,
'checked': checked,
'onvalue': onvalue,
'offvalue': offvalue,
'text': text}
I put my modifications to tksheet here to get your point of view on that:
https://github.com/skedus/tksheet/tree/try_checkbox
with an example of used
https://github.com/skedus/tksheet/blob/try_checkbox/examples/example_checkbox_01.py
Tell me if it can be a way of doing it ?
The text was updated successfully, but these errors were encountered: