Akascape / CTkTable

Customtkinter Table widget (extension/add-on)
MIT License
265 stars 15 forks source link

Creating a search feature using delete_rows(), turns in an error #39

Closed broshv closed 1 year ago

broshv commented 1 year ago

Hi there, I'm implementing a search feature to my password manager.

This is my code so far (I'm still working on the deleting part):

def startsearch():
    name_record = keywordbox.get()
    choice_record = choice.get()

    rowstodelete = []

    if name_record != "" and choice_record != "":
        for record in range(len(table.get())):
            if record != 0 and record != len(values) - 1:
                rowstodelete.append(record)
                print("yes to ",record)
            print(record)

        table.delete_rows(rowstodelete)
        rowstodelete = []
        rroot.destroy()

This is what comes out of the output:

0
yes to  1
1
yes to  2
2
3
Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11\Lib\tkinter\__init__.py", line 1948, in __call__
    return self.func(*args)
           ^^^^^^^^^^^^^^^^
  File "C:\Users\--\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11\LocalCache\local-packages\Python311\site-packages\customtkinter\windows\widgets\ctk_button.py", line 554, in _clicked
    self._command()
  File "c:\Users\--\OneDrive\Documents\BRAISOpyDEV\RAW\BETA0.1\allfunctions\password.py", line 37, in startsearch
    table.delete_rows(rowstodelete)
  File "C:\Users\--\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11\LocalCache\local-packages\Python311\site-packages\CTkTable\ctktable.py", line 295, in delete_rows
    self.draw_table()
  File "C:\Users\--\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11\LocalCache\local-packages\Python311\site-packages\CTkTable\ctktable.py", line 172, in draw_table
    self.frame[i,j] = customtkinter.CTkButton(self, background_corner_colors=corners,
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: customtkinter.windows.widgets.ctk_button.CTkButton() got multiple values for keyword argument 'text'

What is even going on?

Akascape commented 1 year ago

@broshv Please update the package once and change the previous line of edit_column(text="****") to edit_column(value="****"). This will remove the error. https://github.com/Akascape/CTkTable/issues/38#issuecomment-1653109895