Repository navigation
Conversation
Adds a "Quit Confirmation Dialog" example demonstrating reset_quit, with C++, Python, C# top-level and C# OOP versions plus an output gif.
❌ Deploy Preview for splashkit failed.
|
ralphweng2023
left a comment
There was a problem hiding this comment.
Great work on this one. The counter for cancelled quit requests is a good touch: it makes the effect of reset_quit visible rather than just implied by the prompt closing. However, I would like to request a change to the C# OOP file. It wraps Program in namespace ResetQuit: 119 of the 138 merged OOP examples in the repo use the function name plus Example instead, for example FreeAllConversationsExample and TriangleQuadIntersectExample. Please rename it to namespace ResetQuitExample to match. One smaller note on the same PR: the txt title reads Quit Confirmation Dialog rather than naming reset_quit, which about half of the other input examples do, though this is not a blocker on its own. Once the namespace is updated I will be happy to take another look.
Planner card (best guess - correct me if this is the wrong one): Add usage example for SplashKit input function: key_released
https://teams.microsoft.com/l/entity/com.microsoft.teamspace.tab.planner/mytasks?tenantId=d02378ec-1688-46d5-8540-1c28b5f470f6&webUrl=https%3A%2F%2Ftasks.teams.microsoft.com%2Fteamsui%2FpersonalApp%2Falltasklists&context=%7B%22subEntityId%22%3A%22%2Fv1%2Fplan%2FmIelcQoIgkqhbM8WaPS3sMgAEmyV%2Fview%2Fboard%2Ftask%2FyEibY_NGREa_oB_XvUf0iMgAGNo5%22%7D
Co-authored-by: ralphweng2023 <130116206+ralphweng2023@users.noreply.github.com>
ralphweng2023
left a comment
There was a problem hiding this comment.
Thanks for the quick turnaround: 9135669 renames the OOP namespace to ResetQuitExample as asked, which matches the merged OOP examples, and it is the only file that commit touches. The txt title still reads Quit Confirmation Dialog rather than naming reset_quit, which is fine to leave.
Approved.
Planner card: Add usage example for SplashKit input function: reset_quit
https://teams.microsoft.com/l/entity/com.microsoft.teamspace.tab.planner/mytasks?tenantId=d02378ec-1688-46d5-8540-1c28b5f470f6&webUrl=https%3A%2F%2Ftasks.teams.microsoft.com%2Fteamsui%2FpersonalApp%2Falltasklists&context=%7B%22subEntityId%22%3A%22%2Fv1%2Fplan%2FmIelcQoIgkqhbM8WaPS3sMgAEmyV%2Fview%2Fboard%2Ftask%2FyE8ZVJkBzkO8IY-86EAUUMgAMgbM%22%7D
Nadiazahan
left a comment
There was a problem hiding this comment.
Reviewed the reset_quit usage example and everything looks good to me. The example clearly demonstrates the purpose of reset_quit() by allowing the user to cancel a pending quit request and continue running the program. I also like the cancelled quit counter as it makes the effect of the function easy to see. The required language versions and output GIF are included, and the previous C# OOP namespace issue has been addressed. Approved.
Description
Adds a usage example for the
reset_quitfunction in the Input API, following the format described in/public/usage-examples/CONTRIBUTING.mdx.The example, "Quit Confirmation Dialog", opens a window and watches for a quit request. When the user clicks the window's close button,
quit_requested()becomes true and the program shows a "Really quit?" prompt instead of closing straight away. PressingYconfirms and exits; pressingNcallsreset_quit()to clear the pending quit request so the program keeps running, and the on-screen counter of cancelled quit requests increases.This gives
reset_quita clear, self-contained demonstration of what it actually does: cancelling a quit request that has already been registered.Type of change
How Has This Been Tested?
All four code files were copied into an empty project and run with SplashKit to confirm they behave identically:
Ndismisses the prompt, the program keeps running, and the cancelled counter increments - confirmingreset_quit()cleared the pending request.Ycloses the window and ends the program.Test configuration: Windows 11, SplashKit SDK, C++ (g++), C# (.NET), and Python 3.
Testing Checklist
Checklist
If involving code
Folders and Files Added/Modified
Additional Notes
The example is interactive (keyboard and window input), so a
.gifis included as the output file rather than a.png, as required by the contributing guide.This is the first usage example in the
inputgroup, sopublic/usage-examples/input/previously contained only its README.