Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #96130

Re: pygame basic question

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 <ian.g.kelly@gmail.com>
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 <ahptuap2f1lntqjvimakoul7ue1ie864qn@4ax.com>
References <55eeab88$0$22574$426a74cc@news.free.fr> <ahptuap2f1lntqjvimakoul7ue1ie864qn@4ax.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Tue, 8 Sep 2015 08:12:39 -0600
Subject Re: pygame basic question
To Python <python-list@python.org>
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 <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.224.1441721608.8327.python-list@python.org> (permalink)
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

Show key headers only | View raw


On Tue, Sep 8, 2015 at 8:01 AM, Dave Farrance <df@see.replyto.invalid> wrote:
> "ast" <nomail@invalid.com> 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.

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

pygame basic question "ast" <nomail@invalid.com> - 2015-09-08 11:33 +0200
  Re: pygame basic question Laura Creighton <lac@openend.se> - 2015-09-08 12:14 +0200
  Re: pygame basic question Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-09-08 12:03 +0100
  Re: pygame basic question Dave Farrance <df@see.replyto.invalid> - 2015-09-08 15:01 +0100
    Re: pygame basic question Ian Kelly <ian.g.kelly@gmail.com> - 2015-09-08 08:12 -0600

csiph-web