[pygtk] Blocking signals from widgets

Steve McClure smcclure@racemi.com
21 Oct 2002 16:44:25 -0400


--=-2nWhpUR29+ujY9xJQU/o
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Mon, 2002-10-21 at 15:46, Jakob Kemi wrote:
> Thank you!
>=20
> Is it possible to get this handle from gtk.glade.XML.signal_connect() or=20
> gtk.glade.XML.signal_autoconnect() ?

I don't know. That would have been optimal for me but I didn't find an
answer and I'm not sure that I ever asked on the list.  For the limited
places that I needed it I just added a realize handler to the widget
then manually did the connect and saved the handle.

>=20
> Regards,
> 	Jakob Kemi
>=20
> Steve McClure wrote:
> > On Mon, 2002-10-21 at 11:48, Jakob Kemi wrote:
> >=20
> >>Hi,
> >>
> >>Assume that I've created a program where the "changed" signal emitted f=
rom=20
> >>spinbutton 'a' modifies the value of another spinbutton 'b' and vice ve=
rsa.=20
> >>This of course leads to a loop since the spinbutton widgets keeps affec=
ting=20
> >>each other. Is there some way to temporarily disable a widget from emit=
ting=20
> >>a specific (or all signals, perhaps) signal.
> >>
> >>So that I could write my program like this:
> >>
> >>def on_a_changed(widget, *args):
> >>	b.block_signal ("changed")
> >=20
> >=20
> >         b.signal_handler_block(<handlerHandle>) and
> > signal_handler_unblock are what you are looking for.  The handlerHandle
> > is returned from a connect() call.
> >=20
> >=20
> >>	b.set_value ( "something" )
> >>	b.unblock_signal ("changed")
> >>
> >>Thanks,
> >>	Jakob Kemi
> >>_______________________________________________
> >>pygtk mailing list   pygtk@daa.com.au
> >>http://www.daa.com.au/mailman/listinfo/pygtk
> >>Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
> >=20
>=20
>=20
> _______________________________________________
> pygtk mailing list   pygtk@daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
--=20
Steve McClure			430 10th St NW
Racemi				Suite N-210
http://www.racemi.com		Atlanta, GA 30318
smcclure@racemi.com		voice/fax: 404-892-5850

--=-2nWhpUR29+ujY9xJQU/o
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQA9tGcpwt58YtoWR6kRAiE7AKDM77DkJ8Zg1TKsG+zMgn9mgA7EIACg9LFl
bwYTuFVhVDjhU3qgI9cvs88=
=N7hq
-----END PGP SIGNATURE-----

--=-2nWhpUR29+ujY9xJQU/o--