[pygtk] update notification signals

Steve McClure sMcClure at racemi.com
Wed Dec 6 23:30:55 WST 2006

On Wed, 2006-12-06 at 09:24 +0100, Mikael Lindqvist wrote:
> Hello,
> Is there a way of distinguishing if the value of a control is changed
> by the user or by code in some part of my program?
> To clarify, I'm setting the value of a spinbutton with code, i.e.
> spinbutton.set_value(...) . This causes the value_changed signal to be
> sent to my program. The behavior is the same as when a user modifies
> the value. In the callback I need to be able to distinguishing what
> caused the signal to be fired. Is this possible? Or, better yet, is it
> possible somehow to not have the signal fired when you set the value
> programatically?

AFAIK, there is no way to know this.  I used the techniques you
mentioned.  I either block the emission of the signal or set some sort
of flag that I check in the event handler.

> Thanks in advance,
> -- Mikael
> _______________________________________________
> pygtk mailing list   pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Steve McClure                                     Racemi
email: smcclure at racemi.com                        380 Interstate North Pkwy, SE
voice: 404-892-5850                               Suite 250
fax: 404-892-7215                                 Atlanta, GA 30339

More information about the pygtk mailing list