askYesNo()
Thomas Friedrichsmeier
thomas.friedrichsmeier at ruhr-uni-bochum.de
Tue May 8 09:00:44 UTC 2018
Hi!
Thanks for looking into this.
On Tue, 08 May 2018 00:12:57 +0200
meik michalke <meik.michalke at uni-duesseldorf.de> wrote:
> Am Mittwoch, 25. April 2018, 11:10:59 CEST schrieb Thomas
> Friedrichsmeier:
> > True. Fortunately there seems to be an option() for setting a custom
> > function for this, cleanly. Any volunteer for figuring out, how
> > exactly to map this to the existing rk.show.question()?
>
> the least intrusive way of doing this seems to be setting an option:
[...]
Yes.
> this works out of the box, but the behaviour is not fully identical.
>
> rk.show.question() currently ignores the default value; askYesNo()
> returns it if no answer was entered (i.e., the user just presses
> enter when the question comes up). to emulate this,
> rk.show.question() should be able to preselect the respective button,
> where it currently always defaults to "yes".
>
> so, to fully implement askYesNo() without breaking backwards
> compatibility, we could add a new argument to rk.show.question():
>
> default=TRUE
>
> and when called by askYesNo():
>
> default=default
Ok, added.
> the error if response is NULL emulates what happens when a wrong
> value is entered. askYesNo() raises an error, but if you simply close
> the rk.show.question() dialog it returns NULL.
I do not think this is needed. The error is for an "invalid" response,
as far as I understand (such as answering "I don't know"), while
Cancel is an expected condition, and may be perfectly normal. After all,
askYesNo() does not error on "Cancel", either (but it returns NA,
instead of our NULL). Now, there is a separate question whether closing
the dialog should be the same as Cancel, but that does not seem totally
unreasonable to me, either.
I've also added a gettext() around the default caption, and clarified
documentation on the meaning of "yes", "no", and "cancel" as default
button values, so the option should become much leaner, overall.
Regards
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20180508/cb4da903/attachment.sig>
More information about the rkward-devel
mailing list