Skip to content

CreateWindow

Claude edited this page Oct 26, 2026 · 9 revisions

CreateWindow

Command Index · BlitzPlus · Windows

CreateWindow text$, x%, y%, width%, height%, group%=0, style%=15  ; returns Int

Works in: BlitzPlus

Makes a window and shows it. Windows are the parents of every other gadget: pass the window as the group of a button, label or list to put it inside. The position is relative to the group, which is Desktop for a normal window or another window to make a child that belongs to it.

The style is a sum of these flags, and 15 is the default:

Flag Meaning
1 Title bar
2 The user can resize the window
4 Menu bar, shown with a line under it even before menus are added, see WindowMenu
8 Status bar at the bottom, see SetStatusText
16 Tool window with a smaller title bar and only a close box
32 Width and height are the size of the inside, not of the whole window

Windows send events when they move ($801), change size ($802), are closed ($803) or are activated ($804). Closing does not remove a window by itself, your program decides what to do with the $803 event.

Graphics 320, 240, 32, 2
win = CreateWindow("My window", 20, 20, 260, 180, Desktop(), 15)
CreateLabel "Try the X.", 20, 20, 200, 40, win
SetStatusText win, "Waiting"
asked = 0
Repeat
	e = WaitEvent()
	If e = $803 And EventSource() = win Then
		asked = asked + 1
		SetStatusText win, "Close was asked " + asked + "x"
	EndIf
Until asked = 2

CreateWindow

Parameter Type Default Description
text String required
x Int required Horizontal position inside the group.
y Int required Vertical position inside the group.
width Int required Width of the window.
height Int required Height of the window.
group Int 0 Desktop or another window. Defaults to 0, which means the desktop.
style Int 15 Sum of the flags above. Defaults to 15.

Returns: A handle for the window.

Differences and known gaps:

  • All windows are drawn inside one SDL window and cannot leave it, there are no separate windows of the operating system and no taskbar entries. Windows are drawn in the order they were activated.

Related commands

Command Index · BlitzPlus · Windows

Home · Command Index


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

More

Clone this wiki locally