Entry widget does not emit "editing_done" signal when Enter key is pressed
Description
I see here that "Gtk::CellEditable::signal_editing_done()" should be used to handle "Gtk::activate" signal. But when I press enter after adding a signal handler for the signal, I see that the signal handler is not called.
The documentation says "Implementations of Gtk::CellEditable are responsible for emitting this signal when they are done editing, e.g. Gtk::Entry emits this signal when the user presses Enter." If I understand correctly, after pressing the Enter key, the Entry widget The component should emit this signal
Here is a test code:
#include <gtkmm.h>
#include <iostream>
void press_entry()
{
std::cout << "test from ::press_entry()" << std::endl;
}
class ExampleWindow : public Gtk::Window
{
public:
ExampleWindow();
void press_entry()
{
std::cout << "test from ExampleWindow::press_entry()" << std::endl;
}
private:
Gtk::Entry entry;
};
ExampleWindow::ExampleWindow()
{
set_child(entry);
entry.signal_editing_done().connect([]()
{ std::cout << "test from lambda" << std::endl; });
entry.signal_editing_done().connect(sigc::mem_fun(*this, &ExampleWindow::press_entry));
entry.signal_editing_done().connect(sigc::ptr_fun(&::press_entry));
}
int main(int argc, char *argv[])
{
auto app = Gtk::Application::create("org.gtkmm.entry");
return app->make_window_and_run<ExampleWindow>(argc, argv);
}
Version info
OS:Arch Linux
Kernel: 5.15.33-lts
GUI: GNOME42.0
GTK:4.6.2
GTKMM:4.6.1
other
Please forgive my bad english because english is not my native language
Edited by WhitePr