[pygtk] modal headaches

Christopher Cole ccole2 at mix.wvu.edu
Sat Mar 24 13:41:11 WST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello all, I am trying to write a modal login dialog
in an existing pygtk application. I'm doing something
like this...

            while logon_s.logged_in() is None:
                gtk.main_iteration()

which works perfectly fine...except for the fact that
each time i call the function with this code in it, any
other windows are opened exponentially more times than
they are supposed to be. The use case so far is this:

1 call to function --> every window opens twice
2 calls to function --> every window opens six times
3 calls to function --> every window opens twelve times


I thought the reason for this was because gtk.main_quit()
had to be called after gtk.main_iteration() -- but when i have
something like this:

            while logon_s.logged_in() is None:
                gtk.main_iteration()
            gtk.main_quit()

my entire program dies instead of just the inner main_iteration
loop...!?! Someone please help me on this, I've spent way too much
time trying to figure out something so trivial.

Thanks,
  --Chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGBKvn8Jez60VBYmkRApj3AJ43pao4BdK1c2wrt0s9w64tEGzouACfZxxj
6JR2cVcfxX1yt3/TDB/pt3U=
=2UYw
-----END PGP SIGNATURE-----



More information about the pygtk mailing list