Mac: Creating buttons that you can set the keyboard focus on

Hello,

I’m having problem with my app as it appears on Mac.

I can’t set the user focus on BitmapButtons.

Here’s a screenshot with a few examples:

http://imgur.com/YK2GG

You see there are a few examples of BitmapButtons here: The “+” button, the “X” button, and “New” and “Trash” which are disabled in the background.

I can’t set keyboard focus on any of these. When I press tab, focus just skips the button and goes to the next widget.

This is a problem for me because I want my app to be keyboard-accessible.

I investigated a bit and found that these kind of button is called “Bevel button,” and that they are seldom used in modern apps. Is this true? Is it plain impossible to put keyboard focus on them?

I read about a button called “Gradient button” here:

http://www.uxguide.net/wiki/macos:Buttons#Gradient_Buttons

Maybe this can solve my problem? Is it possible to create a native gradient button with wxPython? Will the user be able to put keyboard focus on it?

Thanks,

Ram.

Whether all widgets are keyboard focusable is a system settings preference that can be changed by the user. Go to System Preferences, click Keyboard and then look at the bottom of the Keyboard Shortcuts notebook page.

···

On 12/16/10 11:16 AM, cool-RR wrote:

Hello,

I'm having problem with my app as it appears on Mac.

I can't set the user focus on BitmapButtons.

Here's a screenshot with a few examples:

http://imgur.com/YK2GG

You see there are a few examples of BitmapButtons here: The "+" button,
the "X" button, and "New" and "Trash" which are disabled in the background.

I can't set keyboard focus on any of these. When I press tab, focus just
skips the button and goes to the next widget.

This is a problem for me because I want my app to be keyboard-accessible.

--
Robin Dunn
Software Craftsman

Ah, I see.

Do you know whether power Mac users often have this setting on? Do you think it’s polite on my program’s behalf to assume that if the user want to press these buttons with the keyboard, that he’ll have this setting on?

Ram.

···

On Thu, Dec 16, 2010 at 9:39 PM, Robin Dunn robin@alldunn.com wrote:

On 12/16/10 11:16 AM, cool-RR wrote:

Hello,

I’m having problem with my app as it appears on Mac.

I can’t set the user focus on BitmapButtons.

Here’s a screenshot with a few examples:

http://imgur.com/YK2GG

You see there are a few examples of BitmapButtons here: The “+” button,

the “X” button, and “New” and “Trash” which are disabled in the background.

I can’t set keyboard focus on any of these. When I press tab, focus just

skips the button and goes to the next widget.

This is a problem for me because I want my app to be keyboard-accessible.

Whether all widgets are keyboard focusable is a system settings preference that can be changed by the user. Go to System Preferences, click Keyboard and then look at the bottom of the Keyboard Shortcuts notebook page.

Robin Dunn

        Hello,

        I'm having problem with my app as it appears on Mac.

        I can't set the user focus on BitmapButtons.

        Here's a screenshot with a few examples:

        http://imgur.com/YK2GG

        You see there are a few examples of BitmapButtons here: The "+"
        button,
        the "X" button, and "New" and "Trash" which are disabled in the
        background.

        I can't set keyboard focus on any of these. When I press tab,
        focus just
        skips the button and goes to the next widget.

        This is a problem for me because I want my app to be
        keyboard-accessible.

    Whether all widgets are keyboard focusable is a system settings
    preference that can be changed by the user. Go to System
    Preferences, click Keyboard and then look at the bottom of the
    Keyboard Shortcuts notebook page.

    --
    Robin Dunn

Ah, I see.

Do you know whether power Mac users often have this setting on?

I couldn't say. I know that is usually the first setting I change when setting up a new OSX machine, but I don't know about the typical user or power user.

<rant>
Personally I think that having that option at all is about the stupidest thing that Apple has done with OSX, why would any user want to be able Tab to only some of the widgets in a form? It seems like a major usability blunder to me, and this from a company that prides itself on making things intuitive and easy to use.
</rant>

Do you
think it's polite on my program's behalf to assume that if the user want
to press these buttons with the keyboard, that he'll have this setting on?

Yes. And be prepared to respond to users' complaints about not being able to tab to the buttons with instructions about how to change the setting in preferences.

···

On 12/16/10 12:02 PM, cool-RR wrote:

On Thu, Dec 16, 2010 at 9:39 PM, Robin Dunn <robin@alldunn.com > <mailto:robin@alldunn.com>> wrote:
    On 12/16/10 11:16 AM, cool-RR wrote:

--
Robin Dunn
Software Craftsman

    Hello,



    I'm having problem with my app as it appears on Mac.



    I can't set the user focus on BitmapButtons.



    Here's a screenshot with a few examples:



    [http://imgur.com/YK2GG](http://imgur.com/YK2GG)



    You see there are a few examples of BitmapButtons here: The "+"

    button,

    the "X" button, and "New" and "Trash" which are disabled in the

    background.



    I can't set keyboard focus on any of these. When I press tab,

    focus just

    skips the button and goes to the next widget.



    This is a problem for me because I want my app to be

    keyboard-accessible.





Whether all widgets are keyboard focusable is a system settings

preference that can be changed by the user.  Go to System

Preferences, click Keyboard and then look at the bottom of the

Keyboard Shortcuts notebook page.



--

Robin Dunn

Ah, I see.

Do you know whether power Mac users often have this setting on?

I couldn’t say. I know that is usually the first setting I change when setting up a new OSX machine, but I don’t know about the typical user or power user.

Personally I think that having that option at all is about the stupidest thing that Apple has done with OSX, why would any user want to be able Tab to only some of the widgets in a form? It seems like a major usability blunder to me, and this from a company that prides itself on making things intuitive and easy to use.

I agree…

Do you

think it’s polite on my program’s behalf to assume that if the user want

to press these buttons with the keyboard, that he’ll have this setting on?

Yes. And be prepared to respond to users’ complaints about not being able to tab to the buttons with instructions about how to change the setting in preferences.

Haha, thanks for passing down the torch :slight_smile:

I’d like to know though if it’s possible to create the Gradient buttons in wxPython, because by reading Apple’s developer guide I understand that they are more appropriate for my use case.

Ram.

···

On Fri, Dec 17, 2010 at 2:41 AM, Robin Dunn robin@alldunn.com wrote:

On 12/16/10 12:02 PM, cool-RR wrote:

On Thu, Dec 16, 2010 at 9:39 PM, Robin Dunn <robin@alldunn.com > > mailto:robin@alldunn.com> wrote:
On 12/16/10 11:16 AM, cool-RR wrote:

If you use the "Themed" button classes in wx.lib.buttons then you will get buttons that look like the native gradient buttons since they use the native renderer to draw the background of the button. Also, the wx.BitmapButton on Mac builds will use the native gradient button, but I don't think there is a way to get wx.Button to do it unless you are using the 2.9 cocoa build and you put a bitmap on the button.

···

On 12/17/10 12:17 PM, cool-RR wrote:

I'd like to know though if it's possible to create the Gradient buttons
in wxPython, because by reading Apple's developer guide I understand
that they are more appropriate for my use case.

--
Robin Dunn
Software Craftsman

Oh, I guess I was confused, my app was making gradient buttons all along, not bevel buttons. So everything’s perfect.

Thanks,

Ram.

···

On Sat, Dec 18, 2010 at 9:27 PM, Robin Dunn robin@alldunn.com wrote:

On 12/17/10 12:17 PM, cool-RR wrote:

I’d like to know though if it’s possible to create the Gradient buttons

in wxPython, because by reading Apple’s developer guide I understand

that they are more appropriate for my use case.

If you use the “Themed” button classes in wx.lib.buttons then you will get buttons that look like the native gradient buttons since they use the native renderer to draw the background of the button. Also, the wx.BitmapButton on Mac builds will use the native gradient button, but I don’t think there is a way to get wx.Button to do it unless you are using the 2.9 cocoa build and you put a bitmap on the button.

Robin Dunn