avoiding double bounce on any callback

Philippe Strauss <[email protected]> Sat, 02 Oct 2010 20:45:25 +0200
Newsgroups gmane.comp.lang.ocaml.lib.gtk
Message-ID <[email protected]>
Hello LablGTK users,

in the app that I'm developping since a while now, I always get an entry 
in the callback of a radio buttton twice:

- the wanted behaviour: when the radio button change, I enter my callback
- but also an unwanted one, at least in my app: when re-chanching the 
radio button, I enter my callback with the old state, like leaving this 
state, and then re-entering my callback with the new state.

exemple: some Printf debug of my app, acted upon by a two radio button, 
labeled left and right (the two channel of stereo, it's an audio app), 
defaulting to the left channel, numbered 0:

clicking on the right channel radio button:
(Dbg) entering draw_impulse
(Dbg) on_channel: setting to 0
(Dbg) entering draw_impulse
(Dbg) on_channel: setting to 1

... callback action ended.
now clicking on the left radio button:

(Dbg) entering draw_impulse
(Dbg) on_channel: setting to 1
(Dbg) entering draw_impulse
(Dbg) on_channel: setting to 0

... Done. etc.

(Dbg) entering draw_impulse
(Dbg) on_channel: setting to 0
(Dbg) entering draw_impulse
(Dbg) on_channel: setting to 1
(Dbg) entering draw_impulse


How, on the LablGTK level, avoid this ?
(I can circumvent it myself but find this double bounce thing rather 
weird in the first place).


Regards.


-- 
Ph. Strauss