[Gtk-sharp-list] Re: Bug? : Changing CheckButton.Active Fires Clicked Event

Archie Maskill galepsus at gmail.com
Tue Oct 25 05:25:03 EDT 2005

It looks like this is more of a feature than a bug; the clicked event
is also thrown in GTK+ when the "active" state of a toggle button is
changed using gtk_toggle_button_set_active.  The GTK+ users get round
it by blocking/unblocking signals as needed.  I've looked around, but
it doesn't look like that functionality has made it in to GTK# yet. 
Is this true, and does anyone know when that is likely to happen?

My other question is : how do the rest of you cope when you need to
override the OnClicked() method for a toggle button (or derived), and
then need to set the Active property manually without further unwanted
calls to OnClicked?


On 10/21/05, Archie Maskill <galepsus at gmail.com> wrote:
> I can't quite tell if this is a bug or a feature...
> When the Active property of a CheckBox is changed, a CheckBox.Clicked
> event is fired.  While Clicked events often precede changes in a
> CheckBox, surely a Clicked event should only represent the actual
> clicking on a CheckBox by the user and not by some other indirect
> means (i.e. changing Active)?
> I have a GUI that directly reflects the state of some variables
> somewhere.  I have overriden the OnClicked() method so that when a
> CheckBox is clicked some validation can be done before the value of
> the box is allowed to change.  When the validation is completed, the
> Active property is changed.  Unfortunately, this causes a second
> Clicked event to be fired, the validation code runs again and the
> value is returned to what it was when the first physical click
> occurred.  Two clicks for the price of one.  :)
> <truncated>

More information about the Gtk-sharp-list mailing list