enthought / enthought/traitsui

Creating an editor to display a button opening a pop-up menu with actions

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

Description

Hi there! This issue is to suggest the creation of a new editor, for convenience named `MenuButtonEditor` here, which would display a button that opens a menu when clicked, a bit like [this example](https://doc.qt.io/qt-5/qpushbutton.html#setMenu):

![image](https://user-images.githubusercontent.com/24434420/122022382-d377e200-cdc6-11eb-9912-fb2a2bc8f7ec.png)

This editor could be the default one for a `Menu` trait for instance. It would otherwise work like a normal button, with the possibility to set its style (_normal_ or _toolbar_), its label and image. Ideally, it could be included in a toolbar.

A simple first pass could consist of using `QPushButton.setMenu()`, as it does exactly that (as shown in the picture above).

What do you think ?

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.