Make GTK Entry only focusable on click but gain keyboard control if selected

北慕城南 提交于 2020-01-25 10:13:58

问题


I have a GtkBox with some GtkEntry elements inside.

Some of them should not be focused by keyboard-tab. Only when clicking on them. How can this be achieved?

If I set gtk_widget_set_can_focus to FALSE for an Entry I solved the focus problem. But cannot interact with the keyboard anymore.

What is a proper solution for not accepting focus by keyboard but on click within Gtk 3.18.9?


回答1:


You can use gtk_container_set_focus_chain() for that.



来源:https://stackoverflow.com/questions/59680184/make-gtk-entry-only-focusable-on-click-but-gain-keyboard-control-if-selected

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!