Skip to content

Commit f6998d4

Browse files
committed
fixed Sphinx errors
1 parent aa7d279 commit f6998d4

File tree

1 file changed

+26
-24
lines changed

1 file changed

+26
-24
lines changed

docs/reST/ref/window.rst

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -46,40 +46,42 @@
4646

4747
Event behavior if one Window is created: When the close button is pressed,
4848
the ``QUIT`` event will be sent to the event queue.
49-
.. code-block:: python
50-
51-
import pygame
5249

53-
window = pygame.Window()
50+
.. code-block:: python
5451
55-
while True:
56-
for event in pygame.event.get():
57-
if event.type == pygame.QUIT:
58-
pygame.quit()
59-
raise SystemExit
52+
import pygame
53+
54+
window = pygame.Window()
55+
56+
while True:
57+
for event in pygame.event.get():
58+
if event.type == pygame.QUIT:
59+
pygame.quit()
60+
raise SystemExit
6061
6162
Event behavior if multiple Windows are created: When the close button is
6263
pressed, a ``WINDOWCLOSE`` event is sent. You need to explicitly destroy
6364
the window. Note that the event ``QUIT`` will only be sent if all Window
6465
has been destroyed.
65-
.. code-block:: python
66-
67-
import pygame
6866

69-
window1 = pygame.Window(position=(0,100))
70-
window2 = pygame.Window(position=(700,100))
67+
.. code-block:: python
7168
72-
while True:
73-
for event in pygame.event.get():
74-
if event.type == pygame.WINDOWCLOSE:
75-
id = event.window.id
76-
print(f"WINDOWCLOSE event sent to Window #{id}.")
77-
event.window.destroy()
69+
import pygame
7870
79-
if event.type == pygame.QUIT:
80-
print(f"Last window is destroyed. QUIT event was sent.")
81-
pygame.quit()
82-
raise SystemExit
71+
window1 = pygame.Window(position=(0,100))
72+
window2 = pygame.Window(position=(700,100))
73+
74+
while True:
75+
for event in pygame.event.get():
76+
if event.type == pygame.WINDOWCLOSE:
77+
id = event.window.id
78+
print(f"WINDOWCLOSE event sent to Window #{id}.")
79+
event.window.destroy()
80+
81+
if event.type == pygame.QUIT:
82+
print(f"Last window is destroyed. QUIT event was sent.")
83+
pygame.quit()
84+
raise SystemExit
8385
8486
.. versionadded:: 2.4.0
8587
.. versionchanged:: 2.5.0 when ``opengl`` is ``True``, the ``Window`` has an OpenGL context created by pygame

0 commit comments

Comments
 (0)