| 1 | # TextEditor Example |
| 2 | |
| 3 | This directory contains a full example on how to use the TextEditor widget. |
| 4 | It implements a poor man's editor complete with menubar, statusbar, |
| 5 | file selectors, status tracking and autocomplete. |
| 6 | |
| 7 |  |
| 8 | |
| 9 | It uses the SDL3 GPU rendering backend and comes with CMake support so |
| 10 | you should be able to run it on MacOS, Linux and Windows. Here are |
| 11 | the instructions on how to get started based on platform and |
| 12 | development tools. |
| 13 | |
| 14 | ## Visual Studio Code |
| 15 | |
| 16 | - This should work on MacOS (tested), Linux (untested) and Windows (untested). |
| 17 | - Ensure you have the C++ and CMake extensions activated in your installation. |
| 18 | - Open the top-level ImGuiColorTextEdit folder. |
| 19 | - As the top-level does not contain a CMakeList.txt file, tell Visual Studio Code you want to use the example/CMakeList.txt file. |
| 20 | - When you build the executable, the dependencies (SDL3, Dear ImGui and ImGuiFileDialog) will be automatically downloaded. |
| 21 | |
| 22 | ## Xcode |
| 23 | |
| 24 | - You can generate the Xcode project file from the command line: |
| 25 | - Install **homebrew** using the instructions at [https://brew.sh](https://brew.sh). |
| 26 | - Install git using **brew install git** from the command line. |
| 27 | - Install Cmake using **brew install cmake** from the command line. |
| 28 | - Run the following in the **examples** folder: **cmake -B ../build -G Xcode**. |
| 29 | - You now have an Xcode project in the top-level **build** folder. |
| 30 | - This step is only required once. |
| 31 | |
| 32 | ## Visual Studio |
| 33 | |
| 34 | - Visual Studio has CMake integration so you should be able to do it in a similar way to Visual Studio Code. |
| 35 | |
| 36 | ## Command line |
| 37 | |
| 38 | - MacOS: |
| 39 | - Installing **homebrew** using the instructions at [https://brew.sh](https://brew.sh). |
| 40 | - Installing git using **brew install git** from the command line. |
| 41 | - Installing Cmake using **brew install cmake** from the command line. |
| 42 | - Install Ninja using **brew install ninja** from the command line. |
| 43 | |
| 44 | - Linux: |
| 45 | - Ensure the **build-essential**, **cmake** and **ninja-build** packages are installed. |
| 46 | |
| 47 | - All platforms |
| 48 | - Run the following commands: |
| 49 | - **cd example** |
| 50 | - **cmake -B ../build -G "Ninja Multi-Config"** |
| 51 | - **cmake --build ../build --config Debug** |
| 52 | - The executable should now be at **ImGuiColorTextEdit/build/Debug/example** |