prompt-toolkit / python-prompt-toolkit

Library for building powerful interactive command line applications in Python
https://python-prompt-toolkit.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
9.1k stars 717 forks source link

Provide a vertical menu widget #1838

Open lpenz opened 6 months ago

lpenz commented 6 months ago

VertMenu is a full screen vertical menu widget that supports efficient item updates and has a callback for menu movement.

I tried using FormattedTextControl to create a simple menu for a full-screen application and it was somewhat slow - and the documentation actually says that it's "for rather small widgets, like toolbars, menus". So I created this as a more optimized widget for vertical menus, supporting item updates and with a callback that is triggered when the selected item changes. I have this today as part of https://github.com/lpenz/ptvertmenu but I think vertical menus are somewhat common in full-screen console programs.

Let me know if there's any interest in incorporating this.