[Lumiera] Question about sigc++

Ichthyostega prg at ichthyostega.de
Sun Oct 9 20:40:56 CEST 2011

Am 09.10.2011 18:55, schrieb Michael Fisher:
> (Trying to Connect my ZoomScale to a timeline state changed signal.)

> I looked at the sigc++ docs and tutorial and as far as I can tell I'm doing
> this correctly, but obviously not because I get very strange looking (to me)
> compile errors.

looking strange not only to you...
I'll bet these are errors from some C++ template code. These
are quite precise, but overwhelmingly verbose and often quite
misleading. It takes some practice to learn "parsing" those
errors and guessing what's wrong.

> in timeline-panel.cpp after all other widgets are g2g.

> zoomScale.set_view_window(timelineWidget->get_state()->get_view_window());
>   timelineWidget->signal_state_changed().
>     connect(sigc::mem_fun(zoomScale,
>             &TimelineZoomScale::on_timeline_state_changed));

This looks OK-ish at first sight, but I'd need to see (and try out) your
actual code, and I'd need to see those error messages, in order to find
out what's wrong.

The sigc++ signals and slots are based on a concept called "functor".
That is a "function object", which can be passed on like a value.
But you can also *invoke* it like a function. For this invocation
to work, the actual arguments (number and types) must match the
functor's argument types. This is something checked already
by the compiler. In case of a mismatch here, he compiler
loves to spit out these endless template errors, see above.

Anyway, I think it's time you get your own public Git repository.
Because then I could easily look at your code, and collaboration
becomes way simpler.

Well, unfortunately our Mob repo is broken right now, because
we could use that as well, but since you want to contribute
more, we don't hesitate to give you an account on your own.

See you at IRC!


More information about the Lumiera mailing list