For example create 2 entries and test them if they are focused with is_focus() or has_focus(). It always answer false even if i use grab_focus().
If i test another focus widget it answers true.
So how to check and know which entry is used by a user ?
Better describe what you really intend, not what you do. I have no idea why someone may want to query focus for a widget. For your task, maybe Gtk.Widget.get_state_flags would help, I played with that function myself recently. But maybe what you desire is just connecting to a signal?
Generally we connect to the āactivateā or the āchangedā signal for a GtkEntry. āactivateā is emitted, when the user pressed RETURN or another meta key, changed is emited for every keystroke. Most of the time āactivateā is what we want ā if the user is done with his input, we get the new string. I can not tell you how you connect to signals in gtkmm, I have used only C, Python, Ruby, Nim. But you should find that in the gtkmm tutorials, or just ask here again.
NOTE: not sure if an overload of Gtk::Widget::is_ancestor() taking a const reference as an argument exists. If you find issues, remove all the const qualifiers from the sample above.
That is an interesting idea. But I have the strong feeling, that the initial poster just is new to GTK and has to learn how one connect widget signals to callback functions.