Skip to content

Add window_has_focus usage example#754

Open
Osaid2993 wants to merge 1 commit into
thoth-tech:mainfrom
Osaid2993:window-has-focus-usage-example
Open

Add window_has_focus usage example#754
Osaid2993 wants to merge 1 commit into
thoth-tech:mainfrom
Osaid2993:window-has-focus-usage-example

Conversation

@Osaid2993
Copy link
Copy Markdown

Description

Splashkit Function: window_has_focus

Overview of example functionality: This example demonstrates how to use the window_has_focus function. It opens a window and displays whether that window currently has focus. This helps beginners understand that the function checks if the window is the active focused window.

Example Output:

window_has_focus-1-example

Files Included

  • C++ code
  • C# code (Top-Level statements)
  • C# code (Object-Oriented Programming)
  • Python code
  • Relevant title for the example (.txt)
  • Screenshot

Usage Example Checks

  • Code uses Splashkit function above
  • Code does not use non-Splashkit functions
  • Code does not use extra function declarations or extra classes
  • Code does not violate any of the Thoth Tech SplashKit Style Guide rules
  • Simple, clear demonstration of the function
  • Tested in Chrome and Firefox

@netlify
Copy link
Copy Markdown

netlify Bot commented May 4, 2026

Deploy Preview for splashkit failed.

Name Link
🔨 Latest commit 2feb6fa
🔍 Latest deploy log https://app.netlify.com/projects/splashkit/deploys/69f84ccf51beff0008c6b468

Copy link
Copy Markdown

@jankiluitel jankiluitel left a comment

Choose a reason for hiding this comment

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

It looks good—this is a concise, well-organized example of how to use window_has_focus in several languages.

The accompanying GIF accurately illustrates the behaviour, and the implementation is consistent and simple to follow. Everything comes together neatly and fits in nicely with the usage examples that are already in place.

A minor observation: the "focus" and "not focus" messages have slightly different text placements, but this is not a barrier.

Overall, excellent addition—approving

Copy link
Copy Markdown

@222448082Ashen 222448082Ashen left a comment

Choose a reason for hiding this comment

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

Description

This PR adds a new usage example for the WindowHasFocus function in the Windows category. It provides consistent demonstrations across C++, C# (Top-level and OOP), and Python, showing how to detect if the application window currently has input focus.

Type of change

  • Documentation (update or new)

How Has This Been Tested?

  • Verified file structure in public/usage-examples/windows/.
  • Manually reviewed code logic for all language implementations.
  • npm run build (Blocked by local environment issues, but code logic is verified).

Checklist

If involving code

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

If modified config files

N/A

Folders and Files Added/Modified

  • Added:
    • public/usage-examples/windows/window_has_focus-1-example.cpp
    • public/usage-examples/windows/window_has_focus-1-example-oop.cs
    • public/usage-examples/windows/window_has_focus-1-example-top-level.cs
    • public/usage-examples/windows/window_has_focus-1-example.py
    • public/usage-examples/windows/window_has_focus-1-example.txt
    • public/usage-examples/windows/window_has_focus-1-example.gif

@Osaid2993
Copy link
Copy Markdown
Author

@222448082Ashen Could you please approve this PR ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants