ragardner / tksheet

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

Deleting popup_menu. #229

Open Akselrud opened 5 months ago

Akselrud commented 5 months 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 5 months 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 5 months 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 5 months 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

skedus commented 4 weeks ago

Hi, I had the same question ;-) the right clic built-in menu seems to be manage for cell level and row level but sometime copy/paste/delete at cell level is ok, but not at row level because some cells have specific edition. So yes that would be nice to control row menu and activate functionality or not Thanks