bwidgets/examples/button_example.cpp

20 lines
411 B
C++

#include <iostream>
#include <basic_widgets/w/button.hpp>
#include "run.hpp"
using bwidgets::Button;
auto main() -> int
{
run_example<Button>([](auto* w, auto* f, auto x, auto y) {
w->click_handler = [x, y](const SDL_MouseButtonEvent&) {
std::cout << "button(" << x << ',' << y << "):click!" << std::endl;
};
w->font(f);
w->text("+");
});
return 0;
}