[pygtk] Geting a window/dialog to appear on a different screen.

finlay finlay at moeraki.com
Wed Jun 4 15:04:08 WST 2008


Neil Dugan wrote:
> Hi,
>
> I have a LTSP set-up here.  I would like to put a window or dialog on 
> the client screens, but I can't seem to get this to happen I am 
> getting weird errors from gtk.main().
>
> See attachment for the code.
>
> The errors I am getting are
> /media/tmp/testgui:43: GtkWarning: gdk_screen_get_display: assertion 
> `GDK_IS_SCREEN (screen)' failed
>   gtk.main()
> /media/tmp/testgui:43: GtkWarning: gdk_keymap_get_for_display: 
> assertion `GDK_IS_DISPLAY (display)' failed
>   gtk.main()
> /media/tmp/testgui:43: Warning: invalid (NULL) pointer instance
>   gtk.main()
> /media/tmp/testgui:43: Warning: g_signal_connect_data: assertion 
> `G_TYPE_CHECK_INSTANCE (instance)' failed
>   gtk.main()
> Traceback (most recent call last):
>   File "/media/tmp/testgui", line 43, in <module>
>     gtk.main()
>
>
> If I comment out line 20 
> "window.set_screen(display.get_screen(screen))" all works as expected.
>
> Any help appreciated.
The Display object (and probably the Screen object) created by Window() 
are dereferenced after the function returns and being destroyed. A 
reference to display needs to be maintained somewhere e.g. return it 
from Window() or save it as an attribute of window or something similar.

John


More information about the pygtk mailing list