Re: Toggle Button problem

Archie Maskill ha scritto:
I was hoping if someone could explain why the following is a feature
and not a bug : when the gtk_toggle_button_set_active method is
called, two events are fired - a "toggled" event and a "clicked"
event.  This doesn't seem to make sense if the Toggle Button isn't
actually being clicked, and doesn't seem to allow a test for the
"active" field being toggled without being clicked.
IIRC it's the intended behaviour, and many programs rely on it.
And these signals should be fired only if your call actually changes the button's state (hope my memory still works...).

[...] However, once validation
completes, I change the state of the "active" field, but this causes a
clicked event to fire.  The program thinks the user has clicked on the
CheckButton again, but no such thing happened!  The validation routine
runs again, which causes "active" to change which causes another
clicked event, and so on and so on...
You should block signal emission, call _set_active, then unblock. This way your state changes are not reported as events.

So, in my opinion, this isn't the correct behaviour, and changing
"active" should NOT fire a clicked event.  If I'm wrong and this *is*
the correct behaviour, could someone explain *why* it is the correct
Hope I've been clear.


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