Re: [code] [textadept] Are you a keyboard junkie?

From: Pete Kazmier <pete.att.kazmier.com>
Date: Tue, 9 Apr 2013 19:35:52 -0500

On Tue, Apr 9, 2013 at 12:39 PM, Mitchell <m.att.foicica.com> wrote:

> Technically in curses, calling `gui.command_entry.focus()` is blocking, so
> when `focus()` returns, `gui.command_entry.entry_text` holds the text
> entered in. There are a couple ways you can do what you want to do, but
> this provides better encapsulation I think:
>
> -- This will only work in curses since
> -- `gui.command_entry.focus()` is blocking.
> function gui.command_entry.get_command(**)
> local command = ''
> local idx = events.connect(events.COMMAND_**ENTRY_COMMAND,
> function(cmd)
> command = cmd
> return false
> end, 1)
> gui.command_entry.focus()
> events.disconnect(events.**COMMAND_ENTRY_COMMAND, idx)
> return command
> end
>
>
Excellent! I'll give this a try later this week. I didn't realize focus()
was blocking. Thanks!

-- 
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 09 Apr 2013 - 20:35:52 EDT

This archive was generated by hypermail 2.2.0 : Wed 10 Apr 2013 - 06:49:43 EDT