Re: [code] [textadept] Hiding/closing the command entry

From: Chris Emerson <c-ta.att.mail.nosreme.org>
Date: Thu, 14 Mar 2013 10:48:14 +0000

Hi Mitchell,

On Wed, Mar 13, 2013 at 10:33:20PM -0400, Mitchell wrote:
> Unlike in GTK, when you call gui.command_entry.focus() in ncurses,
> the command entry blocks for input so there is no way for control to
> be passed back to Lua to programmatically close it. This is an
> unfortunate platform limitation :(

Ok. In practice I only really want to close it on ESC (which works) and on
Enter once I've done something with the text.

On Enter I seem to have two choices - return true from the
COMMAND_ENTRY_COMMAND event handler so that nothing happens (it stays
open), or not (the entry closes but an error buffer opens since the text
isn't a valid command as far as command_entry is concerned).

As a test I added this at the end of the KEY_ENTER case in c_keypress:

    setExitType((CDKENTRY *)object, KEY_ENTER);

which did what I wanted, but would break everyone else's uses. Could this
be done based on a flag set in gui.command_entry.focus()? That would make
it work slightly more like the GTK case.

Regards,

Chris

-- 
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 Thu 14 Mar 2013 - 06:48:14 EDT

This archive was generated by hypermail 2.2.0 : Fri 15 Mar 2013 - 06:30:01 EDT