2021-07-20 12:12:29 +02:00
|
|
|
#include <iostream>
|
|
|
|
|
2021-08-19 15:00:44 +02:00
|
|
|
#include <basic_widgets/w/widget_factory.hpp>
|
2021-07-20 12:12:29 +02:00
|
|
|
|
|
|
|
#include "run.hpp"
|
|
|
|
|
2021-07-30 20:41:47 +02:00
|
|
|
auto main() -> int
|
2021-07-20 12:12:29 +02:00
|
|
|
{
|
2021-08-19 15:00:44 +02:00
|
|
|
run_example<bwidgets::Button>(
|
|
|
|
[]() { return bwidgets::create_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("click me");
|
|
|
|
});
|
2021-07-20 12:12:29 +02:00
|
|
|
return 0;
|
|
|
|
}
|