Questions about Gtkmm/Libglademm
- From: Timo <timovwb gmail com>
- To: gtkmm-list gnome org
- Subject: Questions about Gtkmm/Libglademm
- Date: Sat, 10 May 2008 21:56:51 +0200
Hello, I wrote a program with PyGTK and Glade, but since I'm learning
C++ for some time now, I want to convert my Python porgram to C++.
I looked trough the few examples and I manage to use my old Glade file
and connect it with C++ code, so that's good.
But what I don't get from the examples is the glade signal handling. In
Glade, I give all widgets already a signal. So the close button gets:
on_close_clicked. In Python/PyGTK this can be simply connected by making
a dictionary, like:
dic = { "on_close_clicked" : gtk.main_quit }
self.wTree.signal_autoconnect(dic)
containing all the signals.
But in the Libglademm examples, they always use lines of code for each
widget to connect the signals, like:
Gtk::Button* pButton = 0;
refXml->get_widget("quit_button", pButton);
if(pButton)
pButton->signal_clicked().connect(
sigc::ptr_fun(&on_button_clicked) );
Isn't there a way to read the signals set in the glade file? That would
save some repeating code.
Timo
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]