I am trying to connect to the GTKMM configure_event signal. Other signals such as property_is_active and delete_event work fine.
in the code sample below, it compiles and runs, but when I move or resize the window with the mouse, the "cout" does not display on the console.
I am baffled at what could be wrong. The code follows, as the GTKMM docs say, the same pattern as other 'events', such as button press, which I have done before: enable the event's MASK, then connect it's signal to my handler. Based on some things "google" returned, I have tried both the add_event(...) shown here, also set_event(...), and included a "show()" either before the add/set call, in an effort to satisfy some hints in old tutorials (possibly from GTK2). There are other posts on various forums suggesting people have gotten past this point when (mostly languages other than C++.
(current Debian Linux, GTK 3)
Any help would be greatly appreciated.
#include <fstream>
#include <istream>
#include <ostream>
#include <iostream>
#include <gdkmm.h>
#include <gtkmm.h>
using namespace std;
class AdjunctWindow : public Gtk::Window {
public:
AdjunctWindow();
~AdjunctWindow();
bool on_configure_changed(GdkEventConfigure* configure_event);
};
AdjunctWindow::AdjunctWindow() {
add_events(Gdk::STRUCTURE_MASK);
signal_configure_event().connect( sigc::mem_fun(*this,
&AdjunctWindow::on_configure_changed));
}
AdjunctWindow::~AdjunctWindow(){
}
bool AdjunctWindow::on_configure_changed(GdkEventConfigure* configure_event) {
cout << "configure changed\n";
return false;
}
int main(int argc, char** argv) {
Gtk::Main kit(argc, argv);
Gtk::Main::run(*(new AdjunctWindow()));
}