Re: libsigc++ question



Andreas Volz schrieb:
I've a main loop where I catch all keyboard input. In that input class
there's a signal that all interested widgets could connect. This works
so far. Now if the main loop gets a key press than a signal is emit and
all connected widgets are informed.

But what if I only like to emit the signal for a group of connected
widgets? With emit() it seems all signal handlers are informed. Maybe
there's a way in the libsigc++ API to signal only some with a special
property set.

For example it's same as in Gtkmm. Only widgets that have the input
focus receive the keyboard input and all other widgets not. How does
that work?

I don't know of the gtkmm implementation. But I think you have 2 possibilities at the sigc level:
- filter the signal in your signal handler
- save a copy of the slot that you connect to the signal and set its blocking state (see <http://libsigc.sourceforge.net/libsigc2/docs/reference/html/classsigc_1_1slot__base.html#69042c2e2b0e5449fbf8203e862192a7>)


Klaus


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