Re: Two events when selecting a RadioButton



Couldn't find that thread.. but yes, I can check for the state of the
button to see which one is active. thanks!

Ok, getting the two events may be useful in some cases, but then we
should have two separated signals, one for just the one that was
activated, and another as it is now.

Ok, it could have some uses, but I think it should be a separated event then

On Sun, Dec 18, 2011 at 9:28 AM, Robert Pearce <rob bdt-home demon co uk> wrote:
> Hi lecas,
>
> On Sun, 18 Dec 2011 02:23:35 +0000 you wrote:
>> Hi,
>>
>> I have some RadioButton's with a function attached to the
>> signal_clicked() event.
>>
>> When I select a RadioButton, I get two events, one for the previous
>> RadioButton that was active, and then another for the RadioButton that
>> I actually selected.
>> If I press the one that is already active, I only get one event.
>>
>> My question is why does two events are triggered? If I just clicked on
>> one of them, I should just get one event.
>
> The signal_slicked for radio buttons doesn't do what it says at all! If
> you check out the thread "Weird RadioButton behaviour" from back in
> May, I was having troubles with it for slightly different reasons.
>
> I suspect, though I haven't examined the code, that signal_clicked is
> actually emitted by any action on the button, including keyboard
> shortcuts, but more importantly including internal state changes. When
> you select button x in a group where button y is active, GTK must
> deactivate button y, and I suspect the mechanism it uses internally is
> the underlying ToggleButton's clicked event.
>
> In reality, it's actually quite useful sometimes to receive a signal
> when a RadioButton is deactivated by one of the others in the group.
> It's also fairly easy to tell the real click from the remote
> deactivation, because in the former case the button will be active when
> your function is called, and in the latter it won't.
>
> HTH
> Rob
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list


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