|
From: Brian G. <bgr...@mo...> - 2006-05-24 04:06:48
|
Jeff Hobbs wrote:
> Bryan Oakley wrote:
>> Jeff Hobbs wrote:
>>> Bryan Oakley wrote:
>>>
>>>> I noticed that with tile 0.7.2, if I click on a button the focus is
>>>> set to that button. Investigating I see it is due to this:
>>>>
>>>> % bind TRadiobutton <1>
>>>> %W instate !disabled { tile::clickToFocus %W; %W state pressed }
>>>>
>>>> Is this an intentional deviation from the standard widget behavior?
>>>> The normal tk widgets don't get focus when you click on them.
>>>
>>>
>>> But normal Windows widgets do (and likely true for other native
>>> widget sets).
>>> Themed widgets should first follow platform style, and only 2nd (in
>>> lieu of
>>> clear platform style) follow traditional Tk style.
>>
>> I guess I'll take your word for it. Wordpad on my machine, for
>> example, doesn't set the focus to a button. I click on the clipboard
>> button on the toolbar and the focus is still in the main part of the UI.
>>
>> On the Mac, run textedit and click on an alignment button on the
>> toolbar and the focus stays in the main part of the UI. Likewise with
>> mail.app, type in a name and click on the "Save as Draft" button on
>> the toolbar and focus seems to stay where it was.
>
> Don't take my word for it, because you are right. I usually go to the
> Display Properties on XP for reference. Lacking radiobuttons there, I
> went to Firefox - which is itself using an emulated native widget set.
> Firefox does set focus on radio click, but you are right that native
> XP widgets don't seem to by default. I can't find this behavior on OS
> X either, even when fiddling with various focus/keypad handling
> preferences.
>
> I would argue that this feature should be controlled by some master
> switch, off by default (or perhaps only on on unix?).
I think it's more complicated then that. In a dialog box, you want
focus to go to buttons so that keyboard traversal is possible (consider
mouse-less operations). When it comes to toolbars; these are just a
short hand way to access menus, and because of the plethora of buttons
there, including them in keyboard traversal would just add too much to
the window. Because of the organization of the menus, it's easier to
invoke stuff from them when using the keyboard. Things like scrollbars
(should) have independent keyboard controls, so there's no need for them
to ever take focus.
So the question to ask is: can I control the take-focus of a button when
I need to, based on where and how the button is used?
-Brian
|