Skip to content

Remove _sdl2.video.messagebox - #3676

Merged
Starbuck5 merged 1 commit into
pygame-community:mainfrom
Starbuck5:remove-sdl2-messagebox
Feb 7, 2026
Merged

Starbuck5 merged 1 commit into
pygame-community:mainfrom
Starbuck5:remove-sdl2-messagebox

Conversation

@Starbuck5

Copy link
Copy Markdown
Member

pygame.display.message_box has been around to replace it since pygame-ce 2.4.0

pygame.display.message_box has been around to replace it since pygame-ce 2.4.0
@Starbuck5
Starbuck5 requested a review from a team as a code owner January 11, 2026 06:24
@Starbuck5 Starbuck5 added the _sdl2 pygame._sdl2 label Jan 11, 2026
@coderabbitai

coderabbitai Bot commented Jan 11, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR removes the messagebox API from the pygame SDL2 video module, including public constants, function implementations, type stubs, and documentation across all relevant files.

Changes

Cohort / File(s) Summary
Core Implementation & SDL Declarations
src_c/cython/pygame/_sdl2/video.pyx, src_c/cython/pygame/_sdl2/video.pxd
Removed messagebox() function implementation with full parameter list and docstring, three constants (MESSAGEBOX_ERROR, MESSAGEBOX_WARNING, MESSAGEBOX_INFORMATION), and SDL extern declarations for message box types, button data, color scheme, and SDL_ShowMessageBox prototype
Type Stubs & Documentation
buildconfig/stubs/pygame/_sdl2/video.pyi, docs/reST/ref/sdl2_video.rst
Removed messagebox function signature and related constants from type stub; removed messagebox function documentation block from reference docs

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Remove _sdl2.video.messagebox' clearly and specifically describes the main change: removing the messagebox function from the _sdl2.video module.
Description check ✅ Passed The description explains the rationale for the removal by noting that pygame.display.message_box has been available as a replacement since pygame-ce 2.4.0.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a0c6f0a and 32fb680.

⛔ Files ignored due to path filters (1)
  • src_c/doc/sdl2_video_doc.h is excluded by !src_c/doc/*
📒 Files selected for processing (4)
  • buildconfig/stubs/pygame/_sdl2/video.pyi
  • docs/reST/ref/sdl2_video.rst
  • src_c/cython/pygame/_sdl2/video.pxd
  • src_c/cython/pygame/_sdl2/video.pyx
💤 Files with no reviewable changes (4)
  • docs/reST/ref/sdl2_video.rst
  • src_c/cython/pygame/_sdl2/video.pyx
  • buildconfig/stubs/pygame/_sdl2/video.pyi
  • src_c/cython/pygame/_sdl2/video.pxd
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: arm64
  • GitHub Check: build (ubuntu-22.04)
  • GitHub Check: debug_coverage (ubuntu-24.04, 3.10.17)
  • GitHub Check: Debian (Bookworm - 12) [ppc64le]
  • GitHub Check: debug_coverage (ubuntu-24.04, 3.14.0)
  • GitHub Check: Debian (Bookworm - 12) [s390x]
  • GitHub Check: Debian (Bookworm - 12) [armv6]
  • GitHub Check: dev-check
  • GitHub Check: msys2 (ucrt64, ucrt-x86_64)
  • GitHub Check: x86_64
  • GitHub Check: aarch64
  • GitHub Check: msys2 (clang64, clang-x86_64)
  • GitHub Check: i686
  • GitHub Check: msys2 (mingw64, x86_64)
  • GitHub Check: AMD64
  • GitHub Check: build (macos-14)
  • GitHub Check: build (windows-latest)
  • GitHub Check: build (ubuntu-24.04)
  • GitHub Check: x86
  • GitHub Check: Pyodide build

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ankith26 ankith26 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am neither in favor not against this at the moment. Removing it makes sense but having it does not hurt either? I'm generally unsure of what direction we plan to take _sdl2 in so maybe that is something that must be finalized first before we make any changes here?

@Starbuck5

Copy link
Copy Markdown
Member Author

The vision is to publicize features out of _sdl2 into permanent API locations with rewrites out of Cython. This is what happened with the Window module, this is what should happen with the SDL rendering API stuff.

Since the message box functionality has been available outside of _sdl2 for some time now, it should be removed from _sdl2.

Precedent PR from when Window was migrated: #2294

@Matiiss Matiiss left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Makes sense to get rid of this!

@damusss damusss left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will agree, display.message_box is stable enough, there's no need for a cython duplicate.

@ankith26 ankith26 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets do this 💯

@Starbuck5
Starbuck5 merged commit 86268d7 into pygame-community:main Feb 7, 2026
28 checks passed
@Starbuck5 Starbuck5 added this to the 2.5.7 milestone Feb 7, 2026
@Starbuck5
Starbuck5 deleted the remove-sdl2-messagebox branch February 7, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

_sdl2 pygame._sdl2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants