Re: stopping signals



dave walters wrote:

I'm trying to stop a spinbutton from emitting the "value_changed"
signal when a set_value() is executed in a callback. I tried using
g_signal_stop_emission_by_name() but it didn't work. I've attached the
code. Any ideas on what I'm doing wrong? Thanks,

I neither studied your code nor the problem in detail but could give you
a more general advice. Maybe your strategy is wrong? Three things have
to happen for your signal handler to perform unwanted actions:

1. the signal must be emitted
2. your handler must get connected to the signal
3. your handler must perform respective actions

Why don't you try to change 2. or 3. instead of 1.? 3. should be the
simpliest way. For instance, introduce a tiny flag variable for your
handler, like "skip_input_testing", to indicate that it should skip its
normal actions temporarily. Overhead should be negligible since hundreds
of other signals occur all the time anyway.



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