GTKMM3: on_unrealize not called when closing the window

,

Closing this window no message is printed:

#include <gtkmm.h>

class Area : public Gtk::GLArea
{
	void on_unrealize() override
	{
		Gtk::GLArea::on_unrealize();
		printf("%s\n", __PRETTY_FUNCTION__);
	}
};


class Window : public Gtk::Window 
{
	void on_unrealize() override
	{
		Gtk::Window::on_unrealize();
		printf("%s\n", __PRETTY_FUNCTION__);
	}

public:

	Area area;

    Window() 
	{
		set_size_request(100, 100);
		add(area);
		show_all_children();
    }
};



int main(int argc, char **argv) 
{
    Glib::RefPtr<Gtk::Application> app = 
		Gtk::Application::create(argc, argv, "x.y.z");

    Window window;

    return app->run(window);
}

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.