I would like to add a sigc callback to the destruction of a widget. How can I connect so that when the widget is destroyed, my callback is called? There is no such signal on Gtk::Widget. Can I do it using C API?
Note : I use gtkmm 3.24.5.
I would like to add a sigc callback to the destruction of a widget. How can I connect so that when the widget is destroyed, my callback is called? There is no such signal on Gtk::Widget. Can I do it using C API?
Note : I use gtkmm 3.24.5.
Copyright © 2021 Jogjafile Inc.
I have not found documentation specific to 3.24.5. However, in 3.24.4,
Gtk::Widgetsinherits fromsigc::trackablewhich exposes asigc::trackable::add_destroy_notify_callbackmethod. It seems to be what you are looking after. Here is a quick example to show how it works (Build with Gtkmm 3.24.20):The documentation does not say much (in fact, it says nothing) about what is supposed to be
p_inas well as thevoid*return value from the callback though...Hope this works in Gtkmm 3.24.5.