問題タブ [libsigc++]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
c++ - How to connect GTK+ signals (not gtkmm) to non-static class methods using libsigc++?
The goal is to connect GTK+ signals to non-static class methods using libsigc++ without gtkmm. I want to use the Glade user interface designer to design a non-trivial UI with many views, comparable to a setup wizard. The UI should be portable (Embedded Linux and Windows). So, I want to reduce the dependencies and use the C GTK+ only without the C++ language binding component gtkmm, but the UI should be written in C++. The MVC pattern should be applied to separate the responsibilities and for decoupling. As a result, my C++ views and other classes have to connect their signal handlers to the GTK+ C signals using g_signal_connect()
. Later they have to use g_signal_handlers_disconnect_by_func()
to disconnect the handlers. The following example demonstrates the problem:
File: GladeProgram.h
File: GladeProgram.cpp
File: Main.cpp
The test program (console program) currently runs on Windows 10 and is compiled with Visual Studio 2017.
Any help is appreciated.