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

Re: [pygame] pygame & win id



On Thu, 2005-03-17 at 20:48 +0100, manatlan wrote:
> i need to get the "windows id" of a pygame window ... but xwininfo is
> not able to find the window by the name ...
> how can i get this "windows id" ? how pygame create tis own window ?

Newer versions of SDL have a function pygame.display.get_wm_info().
This returns a dictionary of platform specific values about the display.
Nearly all platforms return a "window" value you could use.

    win = pygame.display.set_mode(resolution)
    info = pygame.display.get_wm_info()
    windowid = info.get("window")
    print "The window ID is", hex(windowid)