Skip to content

Commit

Permalink
Merge pull request #2572 from bilhox/message_box_example
Browse files Browse the repository at this point in the history
Updated ``video.py`` example so it uses ``pygame.display.message_box``
  • Loading branch information
Starbuck5 authored Nov 19, 2023
2 parents 282ed4d + a23a710 commit c3493dd
Showing 1 changed file with 4 additions and 3 deletions.
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

0 comments on commit c3493dd

Please sign in to comment.