Re: [code] [textadept] ui.dialogs

From: Richard Philips <richard.philips.att.gmail.com>
Date: Mon, 20 Jan 2014 14:08:55 +0100

Hello Mitchell,

just to tell you that ui.dialogs.inputbox with tables works perfectly!

There is one minor remark - and I suspect that you considered it as well -

it is a pity that the 'informative_text' and 'text' keys do not match.

This could be solved by putting the main message text in informative_text[0]

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 Mon 20 Jan 2014 - 08:08:55 EST

This archive was generated by hypermail 2.2.0 : Tue 21 Jan 2014 - 06:33:03 EST