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

Re: [pygame] windows screen saver in pygame?



Pete Shinners <pete@shinners.org> writes:

> Syver Enstad wrote:
> > ScreenSaver /p <HWND> - Preview Screen Saver as child of window
> <HWND>.
> 
> 
> therefore, you could still get pygame to do the preview window, the
> init code would look like this...
> 
> if sys.argv[1] == "/p": #preview mode
>      os.environ['SDL_VIDEO_DRIVER'] = 'windib'
>      os.environ['SDL_WINDOWID'] = sys.argv[2]
>      pygame.init()
>      window = pygame.display.set_mode((100,100))
>      width, height = window.get_size()
> else: #regular init mode
>      pygame.init()
>      window = pygame.display.set_mode((640, 480), FULLSCREEN)
>      width, height = window.get_size()

I can't get the windowid hack to work. pygame just puts up it's own
window instead of the hwnd passed in. The docs state that one has to
make a child window of the passed HWND, maybe that is what is wrong.

One could perhaps make a child window with win32gui? I'll look into
that and see what happens.
 
 

-- 

Vennlig hilsen 

Syver Enstad