[pygtk] WNCK question
Magnus Therning
magnus at therning.org
Tue May 23 15:03:28 WST 2006
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)
magnus at therning.org Jabber: magnus.therning at gmail.com
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.daa.com.au/pipermail/pygtk/attachments/20060523/bb83286a/attachment.pgp
More information about the pygtk
mailing list