On Sun, 2007-09-02 at 18:40 +0200, J.B.C.Engelen@...1578... wrote:
I've had some struggle in signals and stuff. I found this in the code:
_close_button.signal_clicked() .connect(sigc::mem_fun(*this, &LayerPropertiesDialog::_close));
(dialogs/layer-properties.cpp)
Why is this connection not saved? Is that not necessary?
The connection is not required unless you want to query or change it. If you never need to do anything like that, you'll never need to save it. It really depends on your object relationship scheme. If they're deleted together, it doesn't matter. It can cause bugs though. There is a bunch of those I dealt in making the pinned dialogs.
P.S. Why is there a function signal_clicked() to get the signal? In my code I just make the sigc::signal public (see /ui/widget/random.h). Is that bad?
Basically you can think of it as an accessor function. Generally these are good because you can change the implementation later more easily. This is part of the problems that we have with style now, almost all the attributes are used directly so it's hard to make the object more efficient.
--Ted