开发者

Not showing focus in wxPython?

开发者 https://www.devze.com 2022-12-17 13:18 出处:网络
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 w开发者_运维百科ant the dotted rectang

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 w开发者_运维百科ant 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?


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号