Skip to content

Step 2 - Open Window

Illustration of window dimensions

The first step in building a graphical program is to open a window. We can then draw onto this. In order to see the picture, we need to also keep the window around for a few seconds before the program ends.

  1. Add a call to open a window that we can draw onto.

    In SplashKit you can open a window to draw onto. To open the window you call the OpenWindow method, and pass it the window’s title, its width and its height.

  2. If the program ends after the window is open, then it wont be around for long enough for the user to see. To fix this we can use the Delay method. You pass it an integer argument for the number of milliseconds to delay. Try delaying for 5000 milliseconds.

    • using static System.Convert;
      using static SplashKitSDK.SplashKit;
      OpenWindow("House Drawing by Andrew", 800, 600);
      Delay(5000);
  3. Compile and run your program. You should see a window open. It should be rectangular, and have the title you set. After five seconds it should close.