Skip to content
On this page
TurboVision Online

Build a complete application

Grow a TurboVision application in small, runnable steps. Begin with the framework defaults, then add application chrome, commands, custom windows, responsive scrolling views, dialogs, controls, and committed form data.

You can run any step from a source checkout:

bash
composer install
php examples/php/tutorial/Guide01.php

Replace Guide01 with any step through Guide16. Each program has a matching test under tests/Feature/, so it is also safe to read as tested framework code.

What you will build

StepsResultContinue with
01–03An application shell with a desktop, status shortcuts, and menusBuild the application shell
04–10Movable windows containing custom-drawn, scrollable, responsive panesAdd windows and scrolling
11–16Modeless and modal dialogs, buttons, choices, input, and committed form dataAdd dialogs and data

Source examples for each step

StepAdditionMain API
01Smallest complete applicationApplication::run()
02Status-line shortcutsinitStatusLine()
03File and Window menusinitMenuBar()
04A command that creates windowshandleEvent(), Desktop::insertWindow()
05A custom view inside each windowView::draw(), Window::insert()
06Lines loaded from a filewriteStr()
07Complete row paintingDrawBuffer, writeLine()
08One scrollable viewportScroller::setLimit(), scrollTo()
09Independently scrolling split panesScrollBar, growMode
10A safe minimum window sizeWindow::sizeLimits()
11A modeless dialogDesktop::insertWindow()
12A modal dialogGroup::execView()
13Default and cancel buttonsButton, Cmd::Ok, Cmd::Cancel
14Check boxes and radio buttonsCheckBoxes, RadioButtons, Label
15Editable textInputLine
16Preload and commit a formDialog::setData(), getData()

Where this guide comes from

The sequence is adapted from Turbo Vision's original C++ tutorial, but the code and recommendations follow this PHP implementation: typed classes, Composer autoloading, collision-free application commands, deterministic window placement, Unicode-aware drawing, and headless tests.

The original material remains in examples/cpp/tutorial, with its original notices. The runnable PHP adaptations are in examples/php/tutorial.

After the guide, use Structure a larger application to turn the single-file teaching style into a maintainable project layout.

Released under the MIT License.