Skip to content

build/api-examples/Button.cpp

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

Source files · Download Button.cpp

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

int main()
{
    gaspardos::gui::Widgets widgets(320, 200);
    gaspardos::gui::Button  item(1, 10, 10, 100, 26, "OK");
    return widgets.add(item) == 0 ? 0 : 1;
}