Re: [code] [textadept] ui.dialogs

From: Richard Philips <richard.philips.att.gmail.com>
Date: Fri, 17 Jan 2014 10:34:24 +0100

Mitchell,

this is just *great*!

I start experimenting ...

Thank you,

Richard

On 01/17/2014 03:00 AM, Mitchell wrote:
> Hi Richard,
>
> On Wed, 15 Jan 2014, Richard Philips wrote:
>
>> [snip]
>>
>>> Yes this is not trivial to implement. It also begs some questions.
>>> Should there be labels next to each inputbox? If so, how should the
>>> API declare them? How should it return the values from all inputboxes?
>>>
>>
>> A suggestion for the API:
>>
>> ui.dialogs.inputbox
>>
>> - if option |informative_text is 'not a table' (string), keep the
>> current functionality
>>
>> - if option informative_text is a table, present a multiline
>> functionality
>> (if it is a table, the option text should be a table as well)
>> return selected button or exit code, table with the input text
>
> This was actually easier than I thought. Latest changes are in
> gtdialog hg and should show up in tonight's nightly build of
> Textadept. For example:
>
> a, b = ui.dialogs.inputbox{informative_text={'msg','1:', '2:', '3:'},
> text={'foo', 'bar', 'baz'}}
> for k, v in pairs(b) do print(k, v) end
>
> --> 1 foo
> --> 2 bar
> --> 3 baz
>
> This works in both GTK and terminal versions.
>
> Cheers,
> Mitchell

-- 
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 Fri 17 Jan 2014 - 04:34:24 EST

This archive was generated by hypermail 2.2.0 : Fri 17 Jan 2014 - 06:27:54 EST