In C, I can autoconnect signals with this code:
gtk_builder_connect_signals (builder, NULL)
How to do this in C++ with GTKmm?
You cannot use Glade to connect your signals when using gtkmm, you need to do that manually.
Glib::RefPtr builder = Gtk::Builder::create_from_file("glade_file.ui");
Gtk::Window *window1 = 0;
builder->get_widget("window1", window1);
Gtk::Button *button1 = 0;
builder->get_widget("button1", button1);
// get other widgets
...
button1->signal_clicked().connect(sigc::mem_fun(*this, &button1_clicked));
Have a look at these answers :
https://stackoverflow.com/a/3191472/1673000
https://stackoverflow.com/a/1637058/1673000
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With