2021-07-20 12:12:29 +02:00
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
#include <basic_widgets/w/button.hpp>
|
|
|
|
|
|
|
|
#include "run.hpp"
|
|
|
|
|
2021-08-06 14:22:56 +02:00
|
|
|
using bwidgets::Button;
|
2021-07-20 12:12:29 +02:00
|
|
|
|
2021-07-30 20:41:47 +02:00
|
|
|
auto main() -> int
|
2021-07-20 12:12:29 +02:00
|
|
|
{
|
2021-08-06 14:22:56 +02:00
|
|
|
run_example<Button>([](auto* w, auto* f, auto x, auto y) {
|
2021-07-29 16:06:03 +02:00
|
|
|
w->click_handler = [x, y](const SDL_MouseButtonEvent&) {
|
|
|
|
std::cout << "button(" << x << ',' << y << "):click!" << std::endl;
|
|
|
|
};
|
|
|
|
w->font(f);
|
|
|
|
w->text("+");
|
|
|
|
});
|
2021-07-20 12:12:29 +02:00
|
|
|
return 0;
|
|
|
|
}
|