Re: gtk_toggle_button_set_active() without emitting toggled signal?



On Tue, 2003-09-23 at 20:47, Gus Koppel wrote:

Joao Rainha wrote:

Is there anyway off setting the toggle button status on ("pressed in") 
withouth the toggled signal be emitted?

The gtk_toggle_button_set_active () function set the button, but emitts
the toggled signal

The objective to display a kind of config dialog window, with the
buttons already active and assigned to some variables, wich can be
changed when the buttons are pressed.

You could use a global flag variable to indicate initalization phase. Set
it before setting the buttons to their desired states and clear it
afterwards. Your handlers could test it at their beginnings and
immediately exit (disregard the event) if it's set.

I'd almost have suggested using the "clicked" instead of the "toggled"
signal for your handler but in fact both seem to be emitted on
gtk_toggle_button_set_active (), at least if the state of the button
actually changes.

Yes both "clicked" and "toggled" are emitted when button changing its
state.

Also, as an option, I could suggest use "clicked" instead, which doesn't
affected by gtk_toggle_button_set_active and reaches the same result.

-- 
Dmitry Koval <koval donapex net>




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