Mailinglist Archive: yast-devel (101 mails)

< Previous Next >
Re: [yast-devel] YCP: how to permanently bind the Enter key to a PushButton?
  • From: Johannes Meixner <jsmeix@xxxxxxx>
  • Date: Wed, 20 Jan 2010 16:47:24 +0100 (CET)
  • Message-id: <alpine.LNX.2.00.1001201619280.7237@xxxxxxxxxxxxxx>

Hello,

FYI:

It seems I found a way how to fix user input usability:

In each run of the UI::UserInput while loop
directly before I call UI::UserInput() I do
first replace the [Search for] button with itself
with `opt(`default) to enforce this default regardless
whatever function call or UI bug may have changed it
and then I set the focus to the InputField for the
search string so that the user can just start typing
and hit Enter to get what he wants.

It does not work the other way round, i.e. first
set the focus then the default widget because it seems
setting the default widget sets also the focus to it.

See source/printer/src/basicadd.ycp in current YaST SVN:
-----------------------------------------------------------------
`ReplacePoint
( `id(`apply_driver_filter_replace_point),
`PushButton
( `id(`apply_driver_filter),
`opt(`default),
_("&Search for")
)
),
...
`InputField
( `id(`driver_filter_input),
.
.
.
any user_input = nil;
while( true )
{ UI::ReplaceWidget( `id(`apply_driver_filter_replace_point),
`PushButton
( `id(`apply_driver_filter),
`opt(`default),
_("&Search for")
)
);
UI::SetFocus( `driver_filter_input );
user_input = UI::UserInput();
------------------------------------------------------------------

At least currently for me on my workstation it works
with Qt and Gtk (regardless of bnc#558900)
as a normal user would presumably expect.

For ncurses UI::SetFocus works well (see next paragraph)
but `opt(`default) seems to work not at all in ncurses
as already explained in Katarina's mail before.

The only minor issue from my usability point of view
in Qt and Gtk is that UI::SetFocus for an InputField preselects
the whole input content so that a single backspace key hit
removes the whole input content instead of only the last
character according to what backspace normally does
(at least in traditional programs which I normally use)
and how it works for ncurses.
But I see this behaviour so often in whatever GUIs
that it seems it was carefully designed to work
nowadays intentionally this way ;-)


Kind Regards
Johannes Meixner
--
SUSE LINUX Products GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany
AG Nuernberg, HRB 16746, GF: Markus Rex
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups