Re: [code] [textadept] Dynamic Menus

From: Mitchell <>
Date: Thu, 4 Oct 2012 14:36:21 -0400 (Eastern Daylight Time)


On Wed, 3 Oct 2012, John Hind wrote:

> One feature I would like to see in TextAdept is dynamic menus. A
> dynamically populated child menu would be a better way of selecting
> buffers or themes for example as opposed to a dialog. The main thing
> needed is an event that gets triggered before a menu or sub-menu
> appears. Then it would be possible to alter the content of the menu
> using Lua scripting. Some enhancements to the event that gets triggered
> when you select a menu item might also be needed to support this.

Why not hook into the `events.BUFFER_NEW` and `events.BUFFER_DELETED`,
regenerate a "static" menu, and then call ``
or `gui.menubar = ...`? It sounds like your idea is to have a top-level
menubar with no child menus, and when one of those menus are clicked, Lua
would create and send the menu for display. I'm not sure if GTK would
display such a submenu that doesn't exist until *after* its first menu
item is clicked.


You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Thu 04 Oct 2012 - 14:36:21 EDT

This archive was generated by hypermail 2.2.0 : Fri 05 Oct 2012 - 06:45:28 EDT