[code] Re: Textadept: replacing a toplevel menubar menu while it is dropped down

From: Phil S. <accountz.att.mailbox.org>
Date: Wed, 7 Nov 2018 11:07:09 +0100

An update on this part:

> as a rather slightly lame workaround, I can append a "Close Menu"
> item at the bottom of this dynamic menu for now.

I noticed I would need to have such an item included in every single
top-level menu to allow interactive "unfreezing" (just in case that is
the one currently open in the critical moment), not just the one about
to be replaced.. even lamer, making the possibility of a future
ui.menu.cancel() or some such API even more appealing ;D

On 11/7/18 2:29 AM, Phil S. wrote:
> I'm doing something a little funky here, bit of an edge case I guess:
>
> one of my top-level menus occasionally gets refreshed programmatically
> with new/different items based on certain events.
>
> When that menu is opened in that very moment, Textadept "sort-of
> freezes" although Scintilla's cursor keeps blinking and the
> still-showing old menu also still reacting to clicks. But you cannot
> cancel/close it in case you DON'T want to pick an item in it. Also no
> reset or quit possible other than via kill sig at this point.
>
> If there was something like ui.menu.close() or
> textadept.menu.menubar.cancel() or so to close it, that situation could
> be prevented by my menu-refresher code.
>
> So that would be a little API feature addition suggestion of mine here
> ;)  as a rather slightly lame workaround, I can append a "Close Menu"
> item at the bottom of this dynamic menu for now.
>
> (I also experimented withprogrammatic menu-cancellation via pretending
> an ESC key-press ala events.emit(events.KEYPRESS, 0xFF1B) but no dice: I
> guess such goes straight to Scintilla, not the outer Xorg / GTK window
> hosting the menu.)

-- 
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 07 Nov 2018 - 05:07:09 EST

This archive was generated by hypermail 2.2.0 : Wed 07 Nov 2018 - 06:31:05 EST