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

From: Phil S. <accountz.att.mailbox.org>
Date: Wed, 7 Nov 2018 02:29:27 +0100

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 Tue 06 Nov 2018 - 20:29:27 EST

This archive was generated by hypermail 2.2.0 : Wed 07 Nov 2018 - 06:30:58 EST