Re: [textadept] menu.lua

From: mitchell <>
Date: Thu, 11 Nov 2010 18:00:19 -0500 (EST)


There is a slightly modified version of your code in latest hg. I did some
reformatting and renamed create_* to set_* because I think it's more

Thanks so much!

> I modified menu.lua [1] to automatically create the id numbers that
> connect menu entries with their actions. This makes it easier to write
> the menus as only one table is necessary instead of three (for menu
> entries, ids, and actions) and some dynamic menu changes simpler like
> Frank's patch to show open buffers in the context menu.
> There is a menubar table in menu.lua that consists of tables for each dropdown.
> menubar = {
> {
> title = L('_File'),
> { L('gtk-new'), { new_buffer } },
> }
> -- ...
> }
> The create_menubar function creates numerical ids and connects them
> with the action for each menu entry and turns them into
> gtkmenus.
> By changing the menubar table and recreating the gtkmenus by calling
> create_menubar again the menu can be changed.
> Some examples that could be placed in init.lua [1]: toggle the menu
> bar visibility with alt+f10, change menu contents, dynamic context
> menu, and a Language specific menu, that is only visible when e.g.
> editing Lua files.
> I've been using this for a few days but I don't know if there might be
> problems with this approach so if anyone wants to try this out, put
> menu.lua in your ~/.textadept/modules/textadept/ and the examples in
> your init.lua.
> Robert
> [1]
> --
> You received this message because you are subscribed to the Google Groups "textadept" group.
> To post to this group, send email to
> To unsubscribe from this group, send email to
> For more options, visit this group at

Received on Thu 11 Nov 2010 - 18:00:19 EST

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:53:30 EST