Re: Gdk.X11Window get_xid() strange behaviour



Seems like a variant of this bug:
https://bugzilla.gnome.org/show_bug.cgi?id=673396

Take care.
--joanie

On 05/19/2012 04:40 PM, Daniel Drake wrote:
> Hi,
> 
> Found some strange behaviour here:
> 
> This code:
> 
> from gi.repository import Gtk
> w = Gtk.Window()
> w.realize()
> print w.get_window()
> print w.get_window().get_xid()
> 
> 
> Fails with:
> 
> <gtk.gdk.X11Window object at 0xb7438d9c (GdkX11Window at 0x9db11f8)>
> Traceback (most recent call last):
>   File "test.py", line 5, in <module>
>     print w.get_window().get_xid()
> AttributeError: 'gtk.gdk.X11Window' object has no attribute 'get_xid'
> 
> 
> 
> However, if I add a GdkX11 import (only change is in line 1):
> 
> from gi.repository import Gtk, GdkX11
> w = Gtk.Window()
> w.realize()
> print w.get_window()
> print w.get_window().get_xid()
> 
> 
> Now it works:
> 
> <X11Window object at 0xb7419a7c (GdkX11Window at 0x95e71f8)>
> 46137347
> 
> 
> In this case I would expect the GdkX11 import to be irrelevant, but
> that seems not to be the case.
> 
> Thanks,
> Daniel
> _______________________________________________
> python-hackers-list mailing list
> python-hackers-list gnome org
> http://mail.gnome.org/mailman/listinfo/python-hackers-list
> 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]