gtk_builder_connect_signals



Hoping to learn object oriented technique of creating GUI with Glade
for C++ I am new to this mailing list.
I seem to have got stuck on my first attempt :(

In C I could use gtk_builder_connect_signals() to connect all the
signals specified in the .glade file but I can't find an equivalent
for C++.

Here is my simplified code. My question is how can I make it connect
all the .glade defined signals without having to do them each and
every one explicitly?

[CODE]
#include <gtkmm.h>

G_MODULE_EXPORT void on_button1_clicked(
	GtkButton *button,
	gpointer data
) {
	printf("button1_clicked\n");
}

int main(int argc, char *argv[]) {
	Gtk::Main kit(argc, argv);

	// instantiate the widgets as defined by glade's XML file
	Glib::RefPtr<Gtk::Builder> builder =
Gtk::Builder::create_from_file("HelloAgain.glade");

	// run with reference to the top level window
	Gtk::Window *pWin = NULL;
	builder->get_widget("window1", pWin);
	Gtk::Main::run(*pWin);
	return 0;
}
[/CODE]

Thanks in advance for any assistance :)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]