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

Re: [pygame] Starting Window Position



Hi

could it be that you can set it only once, before you call pygame.init() ?? Subsequent calls do not change anything afterwards. (perhaps it would work if you quit pygame, reset the env var again and initialize pygame to change the position again)

~DR0ID

Ian Mallett schrieb:
How about a simple python shell code?

import pygame
import sys, os
if sys.platform == 'win32':
        os.environ['SDL_VIDEO_WINDOW_POS'] = '3,23'
pygame.display.set_mode((400,50), 16)

now, at this point, if I go:

if sys.platform == 'win32':
        os.environ['SDL_VIDEO_WINDOW_POS'] = '3,23'
pygame.display.set_mode((200,200), 16)

...the window's position remains at (400,50).

On 6/29/07, * Dave LeCompte (really)* <dave@xxxxxxxxxxxx <mailto:dave@xxxxxxxxxxxx>> wrote:

    "Ian Mallett" <geometrian@xxxxxxxxx <mailto:geometrian@xxxxxxxxx>>
    wrote:
    > It still doesn't work though- it works the first time, and
    subsequent
    > changes to the placement fail.

    Can you describe what the problem you're seeing is a little more?
    You're
    setting the initial position using the SDL environment variable
    method,
    and after the first time you run the script, the initial position
    isn't
    being set?

    Can you send a minimal piece of code that demonstrates the problem?


    Dave LeCompte