问题
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