#includeint main() { CPWindow window("My Window", 640, 480); window.show(); return 0; }
#includeint main() { CPWindow window("My Window", 640, 480); CPButton button("Click me!"); window.add(&button); window.show(); return 0; }
#includeThis code creates a window with a text label and an input box. When the user types something in the input box and presses Enter, the `setCallback()` function is called with the typed value as a parameter. The function updates the text label with the typed value.int main() { CPWindow window("My Window", 640, 480); CPText text("Type something:"); window.add(&text); CPInputBox input; input.setCallback([&](std::string value) { text.setText("You typed: " + value); }); window.add(&input); window.show(); return 0; }