[pygtk] Check if value-changed signal is emitted by user action
Dominic Sacré
dominic.sacre at gmx.de
Thu Feb 28 08:20:38 WST 2008
On Tuesday 26 February 2008 17:09:25 Seltzer wrote:
> I had the same poblem for a long time.
> Right now we let the backend change the value normaly, and dont activate a
> value changed callback.
> For user interaction, we catch both the "button-press-event" and the
> "button-release-event"
> from the hscale. When we catch a button press event, i unblock the
> "value-changed" handler,
> and when we catch a button release event i reblock the handler.
Thanks, that seems to work.
I'm not sure what happens when the user changes the value using the keyboard
though. It's probably not that much of an issue, because value changes will
be less frequent (limited by the keyboard's repeat rate), but still... it
might become a problem somewhere down the road.
Well, I guess if necessary I could still set a simple flag before each
set_value() call, and check for that in the value-changed callback...
Cheers,
Dominic
More information about the pygtk
mailing list