ragardner / tksheet

Python tkinter table widget for displaying tabular data
https://pypi.org/project/tksheet/
MIT License
380 stars 48 forks source link

Deleting popup_menu. #229

Open Akselrud opened 1 month ago

Akselrud commented 1 month ago
  1. How do I remove pop-ups on columns and rows that are always on the grid? (Cut contenst, Copy contenst, Paste ...)
  2. Is it possible to change its content?
ragardner commented 1 month ago

Do you mean you'd like cut, copy, paste enabled and right click popup menus enabled but not have their menu items on popup menus?

The following functions are for adding new commands, not removing in-built ones:

Akselrud commented 1 month ago

Thanks for your explanation! I thought there was an option to remove these pop-ups menus altogether. I make my menus myself successfully. But I thought I could remove the default menus...

ragardner commented 1 month ago

Hello,

To disable the inbuilt popup menu you can use disable_bindings("right_click_popup_menu"), docs here:

https://github.com/ragardner/tksheet/wiki/Version-7#enable-table-functionality-and-bindings

But it's not possible to remove inbuilt functionality that is already enabled from the popup menus if you want to keep that functionality

In other words, if you want to keep copy enabled and keep "right_click_popup_menu" enabled then you can't remove copy from the menu sorry 🫤

I may have to add more ways to modify the inbuilt menus