Re: Gtk::Builder: autoconnecting signal handlers



20.07.2009 15:20, Murray Cumming wrote:
2. Fill a "SlotsContainer" object with named sigc::slots that will be
mentioned in the .glade file, and provide this to
Gtk::Builder::connect_signals().
The important thing is that you don't
need to do that. I implemented that
possibility only because you said it
would make sense, otherwise I wouldn't.
To make that clear, I updated the patch
by adding the connect_signals<T>(void)
templated method. So the usage I recommend,
is either:
refBuilder->connect_signals<MySlots>();
or:
m_refGlade->connect_signals(*this);
depending on the situation; in both cases
filling the SlotsContainer is not needed.

The things like
---
DerivedButton *btn =
	refBuilder->create_widget_derived<DerivedButton>("quit_button4");
slots2.register_slot(GLIBMM_MAKE_SLOT(DerivedButton::on_button_quit), btn);
---
really, as you say, give a very little profit,
but this wasn't my intention. I'd rather disallow
such a usages to make the advantage of the
autoconnect approach very clear. :)


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