Fullscreen window in pythongtk

Markus Schaber use-net at schabi.de
Tue Dec 4 09:58:12 EST 2001


Hi,

I'm currently using python-gtk version 0.6.8-12 (debian woody).

Now I've got the problem that I want to open a fullscreen window (not maximized, but really full screen, means: window in front of all others, no decoration visible).

I tried several variations, my last try was the following code:
===================
#!/usr/bin/env python

from gtk import *
import GDK

#define hooks
def destroy(*args):
    window.hide()
    mainquit()

#create the window
window = GtkWindow(WINDOW_TOPLEVEL)
window.connect("destroy", destroy)
window.set_border_width(1)
window.set_title("Test")

#Try to make the window full screen
window.set_policy(0,0,1)
window.set_position(WIN_POS_CENTER)
window.set_uposition(0,0)
window.set_usize(screen_width(),screen_height())

#add an exit button
Button = GtkButton("exit")
window.add(Button)
Button.connect("clicked", destroy)

#Show the whole thing
window.show_all()
mainloop()
===================
Now the window has the correct size, but the window manager shifts the window left and down so the left and top decoration (title bar etc.) are visible. (I'm using sawfish/gnome. Opera and XAWTV do fullscreen fine.)

During search in some mailing list archives, I found the following C snipplet:
===================
    gdk_window_raise (window->window);
    gdk_window_move_resize (window->window, 0, 0, gdk_screen_width(), gdk_screen_height());
===================

However, the pygtk window doesn't have a window attribute, and the gdk functions window_raise and window_move_resize seem to be left out in the python wrapper.

Does anybody know the trick I missed?

markus
-- 
"GPL software is not free - the cost is cooperation"



More information about the Python-list mailing list