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
{{ message }}
Repository navigation
TableCanvas binds keys and does not unbind them when destroyed #97
When creating a TableCanvas, the widget seems to create some keybindings for table navigation, and then if the widget is subsequently destroyed, it does not release the keybindings, so using those keys generates errors in the terminal.
Specifically, the problem keys seem to be the arrow keys, the number pad arrow keys, return, and delete.
The example below uses toplevel, but that's not required; creating the table in root and destroying it there produces the same behavior.
Operating system: Ubuntu, Windows, raspbian (tried all 3)
Python version: 3.9 and 3.11
Installation method (pip, git clone): pip
import tkinter as tk
from tkintertable import TableCanvas, TableModel
def open_table():
top = tk.Toplevel(root)
top.title("Test Table")
frame = tk.Frame(top)
frame.pack(fill="both", expand=True)
# Sample data
data = {'1': {'A': 'Foo', 'B': 'Bar'},
'2': {'A': 'Baz', 'B': 'Qux'}}
model = TableModel()
model.importDict(data)
table = TableCanvas(frame, model=model)
table.show()
# Button to close the window
close_btn = tk.Button(top, text="Close", command=top.destroy)
close_btn.pack()
# Main application window
root = tk.Tk()
root.title("tkintertable Bug Report")
btn = tk.Button(root, text="Open Table", command=open_table)
btn.pack()
root.mainloop()
Activity