Re: [code][Textadept] Unable to modify context_menu

From: Mitchell <m.att.foicica.com>
Date: Wed, 9 Aug 2017 21:34:09 -0400 (EDT)

Hi Franck,

On Sun, 6 Aug 2017, Franck Guadagnini wrote:

> Hi Robert,
>
> Thank you, it works. It's not documented in the book either.
> I had already tried with "events.INITIALIZED"—after my first email—, but it didn't work. I was trying to replace the context_menu't table by my own.
>
> I've try again following your advice, and got it working this way:
>
> events.connect(events.INITIALIZED, function()
> local context_menu = textadept.menu.context_menu
> local my_table = my_table
>
> for i =1, #my_table do
> context_menu[i] = my_table[i]
> end
> end)

I've committed a fix[1] that allows for updating context menus without wrapping them in `events.INITIALIZED`. (It was already the case that you could update the standard menu without an event wrapper.)

This will be in the next nightly build.

Cheers,
Mitchell

[1]: http://foicica.com/hg/textadept/rev/b691095b2f21

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Wed 09 Aug 2017 - 21:34:09 EDT

This archive was generated by hypermail 2.2.0 : Thu 10 Aug 2017 - 06:38:57 EDT