Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated video.py example so it uses pygame.display.message_box #2572

Merged
merged 4 commits into from
Nov 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions examples/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import os
import pygame

from pygame._sdl2 import Window, Texture, Image, Renderer, get_drivers, messagebox
from pygame._sdl2 import Window, Texture, Image, Renderer, get_drivers

data_dir = os.path.join(os.path.split(os.path.abspath(__file__))[0], "data")

Expand All @@ -29,14 +29,15 @@ def load_img(file):

import random

answer = messagebox(
answer = pygame.display.message_box(
"I will open two windows! Continue?",
"Hello!",
info=True,
message_type="info",
buttons=("Yes", "No", "Chance"),
return_button=0,
escape_button=1,
)

if answer == 1 or (answer == 2 and random.random() < 0.5):
import sys

Expand Down