Path: csiph.com!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.017 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'api.': 0.04; 'subject:question': 0.08; 'instantiated': 0.09; 'internally': 0.09; 'argument': 0.15; '"hello': 0.16; 'pygame': 0.16; 'url:display': 0.16; 'wrote:': 0.16; 'windows': 0.20; '2015': 0.20; 'maintains': 0.22; 'sep': 0.22; 'am,': 0.23; 'second': 0.24; 'header:In-Reply-To:1': 0.24; 'wondering': 0.25; 'message- id:@mail.gmail.com': 0.27; 'function': 0.28; 'actual': 0.28; 'expose': 0.29; 'finds': 0.29; 'window': 0.30; 'writes': 0.30; 'non': 0.32; 'displayed': 0.33; 'tue,': 0.34; 'received:google.com': 0.35; 'skip:> 10': 0.35; 'there': 0.36; 'url:org': 0.36; 'structures': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'display': 0.37; 'skip:p 20': 0.38; 'data': 0.39; 'does': 0.39; 'to:addr:python.org': 0.40; 'skip:n 10': 0.62; 'farrance': 0.84; 'surface': 0.84; 'to:name:python': 0.84; 'hand,': 0.97 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=HgOTPUQy9UsgaXoJRRZrphOTCbl0Sqvr1n9xZUh7jhw=; b=utElD5t6qk0UWDhCw7dKNC7pflEm/Sr/gl7b7a3IhuxlDT2jJCnGNxyXuVpraWUXqJ 5ZMm3vzDHgsQxqUL3JGxychMJ2WiebJz07i9mm+HQKH06/C/RcQGiFls35Uroq5zseT8 Ah4enCuXFAcE0eN/UOWxKvaZCcMXtQKgffADtBcXTwwljFy5xGjJlcz2DJAdxRhVbCfM OnC/TehUkqpCnoxQ3g/nnewekHKLji7OXQREHBczh4gq7SaYCtxR+JdZ8H75x4tSVCE3 ngPgMhgvMKHSrzAynPFUu2h266AdrqQ/4i+DfKO8Amsc47x8lbu0Ip7pMSkqKcseWhQ3 dvsw== X-Received: by 10.170.163.4 with SMTP id f4mr28495203ykd.93.1441721598768; Tue, 08 Sep 2015 07:13:18 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <55eeab88$0$22574$426a74cc@news.free.fr> From: Ian Kelly Date: Tue, 8 Sep 2015 08:12:39 -0600 Subject: Re: pygame basic question To: Python Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1441721608 news.xs4all.nl 23805 [2001:888:2000:d::a6]:32824 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:96130 On Tue, Sep 8, 2015 at 8:01 AM, Dave Farrance wrote: > "ast" wrote: > >>DISPLAYSURF = pygame.display.set_mode((400, 300)) >>pygame.display.set_caption('Hello World!') >> >>The first line opens a 400x300 pygame window. >>The second one writes "Hello World" on top of it. >> >>I am just wondering how function set_caption finds the windows >>since the window's name DISPLAYSURF is not passed as >>an argument > > https://www.pygame.org/docs/ref/display.html > > As it says, there is only *one* display surface, and any non-displayed > surface must be blitted (copied) onto the display surface for > visibility. So all "pygame.display" methods refer to that one display > surface. Non displayed surfaces, on the other hand, do need to be > instantiated with "pygame.Surface" Also, note that the display surface DISPLAYSURF is not the window. It's just a Surface object that pygame uses to paint the contents of the window. AFAIK pygame maintains the actual window data structures internally and does not expose them to the API.