Hi Carlo,
Hi Aitor, is this gtkmm3? For example, Gtk::VBox is deprecated, I'm using Gtk::Grid.
Currently my application just core dumps :(.
The backtrace is:
Thread 1 "tstcpp" received signal SIGSEGV, Segmentation fault.
0x00007ffff6bc29c6 in g_action_map_add_action () from /usr/lib/libgio-2.0.so.0
(gdb) bt
#0 0x00007ffff6bc29c6 in g_action_map_add_action () at /usr/lib/libgio-2.0.so.0
#1 0x00007ffff78cc541 in Gio::ActionMap::add_action(Glib::ustring const&) () at /usr/lib/libgiomm-2.4.so.1
#2 0x00007ffff78cc65e in Gio::ActionMap::add_action(Glib::ustring const&, sigc::slot<void, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil> const&) ()
at /usr/lib/libgiomm-2.4.so.1
#3 0x0000555555573871 in LinuxChessboardWidget::LinuxChessboardWidget(Gtk::Window*, Glib::RefPtr<cwchess::Promotion>) (this=
0x5555563bd928, drawable=0x5555563bd8a0, promotion=..., __in_chrg=<optimized out>, __vtt_parm=<optimized out>)
at /home/carlo/projects/cwchessboard/cwchessboard/LinuxChessboardWidget.cxx:164
#4 0x000055555557b68b in LinuxChessWindow::LinuxChessWindow() (this=0x5555563bd8a0, __in_chrg=<optimized out>, __vtt_parm=<optimized out>)
at /home/carlo/projects/cwchessboard/cwchessboard/LinuxChessWindow.cxx:4
#5 0x000055555556e473 in LinuxChessApplication::create_window() (this=0x5555555f6230) at /home/carlo/projects/cwchessboard/cwchessboard/LinuxChessApplication.cxx:160
#6 0x000055555556e3ed in LinuxChessApplication::on_activate() (this=0x5555555f6230) at /home/carlo/projects/cwchessboard/cwchessboard/LinuxChessApplication.cxx:155
#7 0x00007ffff78bbc2c in Gio::Application_Class::activate_callback(_GApplication*) () at /usr/lib/libgiomm-2.4.so.1
#8 0x00007ffff694480a in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#9 0x00007ffff6944980 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#10 0x00007ffff6bbea89 in () at /usr/lib/libgio-2.0.so.0
#11 0x00007ffff78bba8a in Gio::Application::local_command_line_vfunc(char**&, int&) () at /usr/lib/libgiomm-2.4.so.1
#12 0x00007ffff78bbe51 in Gio::Application_Class::local_command_line_vfunc_callback(_GApplication*, char***, int*) () at /usr/lib/libgiomm-2.4.so.1
#13 0x00007ffff6bbec0a in g_application_run () at /usr/lib/libgio-2.0.so.0
#14 0x000055555557a928 in main(int, char**) (argc=1, argv=0x7fffffffd448) at /home/carlo/projects/cwchessboard/cwchessboard/LinuxChess.cxx:14
Frame #3 (the first that is my code) is:
#3 0x0000555555573871 in LinuxChessboardWidget::LinuxChessboardWidget(this=0x5555563bd928, drawable=0x5555563bd8a0, promotion=...,__in_chrg=<optimized out>, __vtt_parm=<optimized out>)
at /home/carlo/projects/cwchessboard/cwchessboard/LinuxChessboardWidget.cxx:164
164 add_action("ModeShowCandidates", sigc::mem_fun(*this, &LinuxChessboardWidget::on_menu_mode_showcandidates));
Why would this core dump??
LinuxChessboardWidget is defined as:
class LinuxChessboardWidget : public cwmm::ChessPositionWidget, public Gio::ActionMap
{
...
I have to derive from Gio::ActionMap because its constructor is protected.
The call to `add_action` above is to that class.
Can someone tell me what I'm doing wrong?
Mmm..., i don't know, but this issue might be related with some missing arguments in your defined signal/slot.
BTW, i uploaded my third examples including an icon factory for the customized icons of the second part of the menu bar:
https://www.gnuinos.org/Gtkmm Examples/Example_3/screenshot.png
Cheers,
Aitor.