On 5 April 2010 22:30, Søren Hauberg <[email protected]> wrote:
> lør, 03 04 2010 kl. 00:14 -0400, skrev Carnë Draug:
>> I noticed that one of the options for the zenity_file_selection
>> function (part of the zenity package) is 'anything else' which becomes
>> the default selected file. This makes it impossible to have a file as
>> default with the same name as any other option. Also, if someone tries
>> to use any other option but makes a typo, it will not receive an
>> error. Instead, the typo becomes the file selected, even if there's no
>> file with that name.
>
> Yes, this is a potential limitation. Are you actually affected by this
> problem? (just curious...)
No I am not. I just noticed it and thought I could fix it. Specially
if it involves changing the API, the sooner it's done the better.
>> I propose to change this option to "filename=filepath", in a similar
>> way to "timeout=XX" (still in trunk).
>
> I don't quite understand your suggestion. Could you come with an example
> of how the user would call the function?
zenity_file_selection("Please select the best song ever",
"timeout=20", "filename=InertiaticESP.ogg")
This would ask the user to select a file, the window would have the
title "Please select the best song ever", after 20 seconds it would
close the window, and would have selected as default the file
"InertiaticESP.ogg". In the code, this is very easy to implement
if (ischar(option) && regexpi(option, "^timeout=") )
timeout = ["--timeout=", option(9:end)];
if (ischar(option) && regexpi(option, "^filename=") )
filename = ["--filename=", option(10:end)];
> Another option would be to use
> the standard property/value API, such that the user would write
>
> zenity_file_selection (title, option1, ..., "selected file",
> name_of_selected_file)
>
> where "..." can be replaced by any of the other options.
That's an alternative although I think it doesn't look so nice. But if
it's the standard... If there were more options that require a value
would it be zenity_file_selection(title, option1,..., "selected file",
name_of_selected_file, "timeout, timeout_value) ?
Carnë Draug
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev