[pygtk] Geting a window/dialog to appear on a different screen.
finlay at moeraki.com
Wed Jun 4 15:04:08 WST 2008
Neil Dugan wrote:
> 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
> /media/tmp/testgui:43: GtkWarning: gdk_keymap_get_for_display:
> assertion `GDK_IS_DISPLAY (display)' failed
> /media/tmp/testgui:43: Warning: invalid (NULL) pointer instance
> /media/tmp/testgui:43: Warning: g_signal_connect_data: assertion
> `G_TYPE_CHECK_INSTANCE (instance)' failed
> Traceback (most recent call last):
> File "/media/tmp/testgui", line 43, in <module>
> 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.
More information about the pygtk