Re: Interdependent adjustments conundrum



On Tue, 20 Jun 2006 14:59:16 +0200, Patrik Fimml <patrik fimml gmx at> wrote:

The "instance" argument is the object (the GtkAdjustment in your case)
on which the signal has been set. You don't need to keep the IDs, it's
probably much easier to use g_signal_handlers_[un]block_by_func, which
allow you to (un)block handler by instance, function and user_data.

You then put some kind of the following into the handlers of A, B, and
C:

g_signal_handlers_block_by_func(
        D,
        [Function which was connected on D],
        [Data which was connected on D, probably NULL]);

gtk_adjustment_change_value(D, d);

g_signal_handlers_unblock_by_func([same arguments as above]);


This will prevent your callback from being invoked between block and
unblock calls.

Curiously, this doesn't work. I do succeed in blocking the signal; if I omit the unblocking call, the ABC widgets update D quite nicely -- of course if I manually change D nothing happens because the signals stay blocked. However, if I unblock after changing the adjustment's value the app behaves as if the signals had never been blocked, or as if the signal is somehow emitted after the unblocking call. I don't get it.

--robert



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