tksheet icon indicating copy to clipboard operation
tksheet copied to clipboard

readonly_header not work

Open Styca96 opened this issue 3 years ago • 1 comments

I tried to set readonly options for header and i try this command self.cycle_frm.readonly_header(columns=[0, 1, 2]) but i get:

tksheet_tksheet_column_headers.py", line 576, in readonly_header self.cell_options[c]['readonly'] = True KeyError: 0

I have seen that function readonly_rows, readonly_columns, and readonly_cells have this type of line before assign True to readonly key:

if c not in self.col_options:
    self.col_options[c] = {}

If i add these two lines to readonly_header in _tksheet_column_headers.py, it seems to work. (line 572)

else:
    for c in columns_:
        if c not in self.cell_options:
            self.cell_options[c] = {}
        self.cell_options[c]['readonly'] = True

Styca96 avatar Jul 05 '22 07:07 Styca96

Thanks very much for pointing this out to me!

It should be fixed with your addition in 5.4.1

ragardner avatar Jul 29 '22 12:07 ragardner