On Mon, May 22, 2006 at 08:17:55PM +0200, Matthias Bläsing wrote:
>Am Montag, den 22.05.2006, 18:04 +0100 schrieb Magnus Therning:
>> [Problem with wnck not updating without gtk.main]
>> 
>> Hmm, that's a bit irritating. I was hoping to be able to call
>> gtk.main_iteration(0) to trigger that update to be done, but it doesn't
>> seem to work:
>
>> I'm looking to writing a command line tool that does some window
>> manipulation, based on command line arguments, and then exits. Is there
>> a way around having to call gtk.main()?
>
>how about:
>
>import wnck
>import gtk
>scr = wnck.screen_get_default()
>while gtk.events_pending():
>       gtk.main_iteration()
>scr.get_windows()

Works like a charm.

wnck is a strange beast indeed! It seems that after "emptying the event
queue" that way 'scr' is properly updated and all 'get_*()' work fine.

/M

-- 
Magnus Therning                             (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED]             Jabber: [EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

n

Attachment: pgppIxYMfMdRX.pgp
Description: PGP signature

_______________________________________________
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/

Reply via email to