Skip to content

build/api-examples/TextInput.cpp

Complete program from the TextInput API reference. Save it at the path shown above and use the build command in the reference page.

Source files · Download TextInput.cpp

#include "desktop_gui.hpp"
#include <cstdio>
#include <cstring>

int main()
{
    gaspardos::desktop::TextInput input("hello");
    input.key('!');
    std::printf("%s\n", input.visible(30, true).c_str());
    return input.value == "hello!" ? 0 : 1;
}