Skip to content

CreateTextArea

Claude edited this page Oct 26, 2026 · 6 revisions

CreateTextArea

Command Index · BlitzPlus · Text Areas

CreateTextArea x%, y%, width%, height%, group%, style%=0  ; returns Int

Works in: BlitzPlus

Makes a box for editing several lines of text, with scroll bars. The user can type, select with the mouse or with Shift and the arrow keys, and use Ctrl+A, C, X and V. Every change sends a $401 event; TextAreaText reads the result. Style 1 turns line wrapping on so text is only scrolled vertically, and 65536 can be added to not follow the group when it is resized.

Graphics 320, 240, 32, 2
win  = CreateWindow("Notes", 10, 10, 300, 180, Desktop(), 3)
area = CreateTextArea(10, 10, 270, 120, win, 1)
ActivateGadget area
Repeat
	e = WaitEvent()
	If e = $401 Then SetGadgetText win, "Notes - " + TextAreaLen(area) + " chars"
Until e = $803

CreateTextArea

Parameter Type Default Description
x Int required Horizontal position inside the group.
y Int required Vertical position inside the group.
width Int required Width of the text area.
height Int required Height of the text area.
group Int required Window, panel, tabber or canvas that holds it.
style Int 0 1 for wrapping, plus 65536 for not following the group. Defaults to 0.

Returns: A handle for the text area.

Differences and known gaps:

  • Without wrapping, long lines can only be scrolled sideways with the keyboard and the mouse wheel. There is no horizontal scroll bar yet.
  • It is not a rich text control: it holds colors and bold or italic for ranges of text, but no pictures, links or paragraph styles.

Related commands

Command Index · BlitzPlus · Text Areas

Home · Command Index


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

More

Clone this wiki locally