[pygtk] spinbutton set value and signal

Frédéric frederic.mantegazza at gbiloba.org
Thu Nov 6 18:07:22 WST 2008


Le 6/11/2008, "Raúl Núñez de Arenas Coronado" <raul at dervishd.net> a
écrit:

>The call to "set_value()" emits the signal, but it won't be handled
>until the next iteration of the GTK+ main loop, so if you do the
>"stop_emission()" just after "set_value()", the signal just emited by
>the "set_value()" call will be cancelled. If you call it before, the
>signal won't be cancelled.
>
>It's very easy to test: add the call after your current "set_value()"
>code and see if it works. You will be adding only one line of code, so
>if it doesn't work (the docs are not very detailed...) you won't have
>done big modifications to your code.

I tried, but it does not work. In fact, I have a global GUI refresh
method, called in my spinbutton handler. I call the stop_emission()
method after that global refresh, where I have several set_value(),
set_text() and so. As far as I understand, the stop_emission() call will
block only the first set_value() emited signal?

When entering in a signal callback and calling a set_value() method, is
the value-changed signal emited/handled immediatly, or only at the end
of the callback, after it returns?

>Anyway, if you are going to use Glade a lot in your projects, try your
>best to find a way of getting the handler_id. This message says it is
>not possible, but it's from 2003 and maybe things have changed
>http://osdir.com/ml/gnome.gtk+.python/2003-04/msg00092.html

Didn't find a way yet :o(


--
   Frédéric


More information about the pygtk mailing list