tags:

views:

50

answers:

2

I don't know if this is a stupid question, but is there any way to not show focus in wxPython? For example, I built a simple GUI with a few buttons and I don't want the dotted rectangle to show up on the button I have just clicked.

If I remember correctly in Excel VBA you could just set TakeFocusOnClick tag to False. What would be the equivalent in wxPython?

A: 

wxPython uses the native GUI elements on each platform as much as possible and it doesn't seem this is a setting that can be changed. A work-around would be to use a non-native button.

Frank Niessink
A: 

You could also give the focus to another control in your event handler for the buttons. Just call the SetFocus() method on any other control. This might make your application more usable as a side effect if you for example return focus to a text field that is likely to be typed in next.

mrooney