I'm an occasional user of gtkdialog, have a burst of activity, then leave it for sometime. So I never really get in deep, but I am now trying to learn more.
And, I have just hit something that is contrary to my understanding up until now.
If you have some radiobutton, say:
Code: Select all
<frame Radiobutton example>
<radiobutton>
<label>Radiobutton1</label>
<action>echo Radiobutton1 is clicked.</action>
</radiobutton>
<radiobutton>
<label>Radiobutton2</label>
<action>echo Radiobutton2 is clicked.</action>
</radiobutton>
<radiobutton>
<label>Radiobutton3</label>
<action>echo Radiobutton3 is clicked.</action>
</radiobutton>
</frame>
I always assumed that an action would execute if the radiobutton was clicked on. Yes, but the previously-selected radio button also fires it action.
So, initially Radiobutton1 is selected, then I click on Radiobutton2, and I get two echo messages:
Code: Select all
Radiobutton1 is clicked.
Radiobutton2 is clicked.
I think that I have written some broken code in the past, because I didn't understand this.
To me, the default behaviour should be that only the clicked-on button fires its action. Anyway, how to fix this so that it does work as I want?
Well, this does fix it:
Code: Select all
<frame Radiobutton example>
<radiobutton>
<label>Radiobutton1</label>
<action signal="button-release-event">echo Radiobutton1 is clicked.</action>
<action signal="button-release-event">echo DITTO Radiobutton1 is clicked.</action>
</radiobutton>
<radiobutton>
<label>Radiobutton2</label>
<action signal="button-release-event">echo Radiobutton2 is clicked.</action>
<action signal="button-release-event">echo DITTO Radiobutton2 is clicked.</action>
</radiobutton>
<radiobutton>
<label>Radiobutton3</label>
<action signal="button-release-event">echo Radiobutton3 is clicked.</action>
<action signal="button-release-event">echo DITTO Radiobutton3 is clicked.</action>
</radiobutton>
</frame>
Now, if I click Radiobutton2, just get this:
Code: Select all
Radiobutton2 is clicked.
DITTO Radiobutton2 is clicked.
But, is there any other more proper way to do it?