FORGE KUI / learn

Build a desktop app with a title bar

Learn windows, layout and interaction from file-manager and notes applications.

Version 3.61.7

Lesson 09
Before you start
Layout and events completed; able to build C++ projects
What you will build
Two desktop UI styles with real native window controls
Download project ↓agent-studio.zip

Choose an app to run

The default is Chinese Forge Files. --evergreen selects Forge Notes and --english selects English. Both use HTML/CSS without the Ant Design/Evergreen React runtime.

powershell
$cxxStandard = Read-Host SDK-standard
cmake -S . -B build -A x64 "-DCMAKE_CXX_STANDARD=$cxxStandard" -DKui_DIR=C:/SDK/kui-cpp/cmake
cmake --build build --config Release --parallel 4
.\build\Release\agent_studio.exe
.\build\Release\agent_studio.exe --evergreen --english

Locate page and host entry points

index.zh/en.html contains the file manager, notes.zh/en.html the notes app, and app.css shares both styles. main.cpp chooses the page and markdown_preview.h implements a limited Markdown conversion.

Connect controls to native window behavior

A frameless window still needs an obvious close action. Verify minimize, maximize/restore, close and drag regions before restyling controls. This app’s minimum size is 1024×620.

Check the implemented interactions

Distinguish working actions from visual placeholders.

  1. In Files, select README.md and check details; create a folder and inspect the list.
  2. In Notes, edit multiline text and check heading, paragraph and unordered-list preview.
  3. Create and save a note, checking session feedback; no disk persistence is implemented.
  4. Navigation, search and decorative items are not a complete file-management implementation.

Exercise: change style while retaining behavior

Change one style’s accent and spacing without renaming interaction IDs. Run both languages and recheck native controls, editing and saving. Keep text escaping when rendering user content.

Continue toward your own product

Keep model, UI and persistence separate when adding storage, menu commands and errors. Complete one end-to-end action before expanding.