Skip to content
Open
Show file tree
Hide file tree
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
33 changes: 33 additions & 0 deletions public/usage-examples/windows/window-caption-example-oop.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using SplashKitSDK;

namespace WindowCaptionExample
{
public class Program
{
public static void Main()
{
// Open a new window
Window myWindow = SplashKit.OpenWindow("My SplashKit Window", 800, 600);

// Get the window caption
string caption = SplashKit.WindowCaption(myWindow);

// Keep the program running until the user closes the window
while (!SplashKit.QuitRequested())
{
SplashKit.ProcessEvents();

// Draw content on the screen
myWindow.Clear(SplashKit.ColorWhite());

myWindow.DrawText("Window caption:", SplashKit.ColorBlack(), 260, 250);
myWindow.DrawText(caption, SplashKit.ColorBlue(), 260, 290);

myWindow.Refresh();
}

// Close all open windows
SplashKit.CloseAllWindows();
}
}
}
25 changes: 25 additions & 0 deletions public/usage-examples/windows/window-caption-example-top-level.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using static SplashKitSDK.SplashKit;
using SplashKitSDK;

// Open a new window
Window myWindow = OpenWindow("My SplashKit Window", 800, 600);

// Get the window caption
string caption = WindowCaption(myWindow);

// Keep the program running until the user closes the window
while (!QuitRequested())
{
ProcessEvents();

// Draw content on the screen
ClearWindow(myWindow, ColorWhite());

DrawText("Window caption:", ColorBlack(), 260, 250);
DrawText(caption, ColorBlue(), 260, 290);

RefreshWindow(myWindow);
}

// Close all open windows
CloseAllWindows();
29 changes: 29 additions & 0 deletions public/usage-examples/windows/window-caption-example.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include "splashkit.h"

int main()
{
// Open a new window
window my_window = open_window("My SplashKit Window", 800, 600);

// Get the window caption
string caption = window_caption(my_window);

// Keep the program running until the user closes the window
while (!quit_requested())
{
process_events();

// Draw content on the screen
clear_screen(color_white());

draw_text("Window caption:", color_black(), 260, 250);
draw_text(caption, color_blue(), 260, 290);

refresh_screen(60);
}

// Close all open windows
close_all_windows();

return 0;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions public/usage-examples/windows/window-caption-example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from splashkit import *

# Open a new window
my_window = open_window("My SplashKit Window", 800, 600)

# Get the window caption
caption = window_caption(my_window)

# Keep the program running until the user closes the window
while not quit_requested():
process_events()

# Draw content on the screen
clear_screen(color_white())

draw_text("Window caption:", color_black(), 20, 260, option_to_screen())
draw_text(caption, color_blue(), 20, 300, option_to_screen())

refresh_screen_with_target_fps(60)

# Close all open windows
close_all_windows()
1 change: 1 addition & 0 deletions public/usage-examples/windows/window-caption-example.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Window Caption Example