enthought / enthought/traitsui

Make the context menu for the `TableEditor` empty space more customizable

Open
#1,941 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
306
Forks
99
PR merge metrics
No merged PRs in 30d

Description

Feature request.

Currently, on `qt`, the context menu for the empty space (`TableEditor.empty_menu`) contains only an hardcoded action ("Add new item") – which is displayed [conditionally](https://github.com/enthought/traitsui/blob/0239b8b08d41b4087713e747a382c59c1208307c/traitsui/qt4/table_editor.py#L1005-L1007) on `factory.editable and factory.row_factory is not None`.

It would be useful to have more control over it. For instance, the `TableEditor` API object could have an additional trait, besides `menu` (the per-row menu), e.g. `area_menu`.
Both should use the `traitsui.api.Menu` and `traitsui.api.Action` interface.

([Currently](https://github.com/enthought/traitsui/blob/0239b8b08d41b4087713e747a382c59c1208307c/traitsui/qt4/table_editor.py#L145) the QT specific `TableEditor` has a `empty_menu` attribute which is, however, a `QtGui.QMenu` – not intended for the high-level user)

Inspired by the use-case in #1940

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.