demonstrates the use of xtd::forms::timer component.
- Windows
-
- macOS
-
- Gnome
-
#include <xtd/forms/application>
#include <xtd/forms/button>
#include <xtd/forms/form>
#include <xtd/forms/label>
namespace timer_example {
class form1 :
public form {
public:
form1() {
label1.location({10, 10});
label1.auto_size(true);
timer1.enabled(!timer1.enabled());
button1.text(timer1.enabled() ?
"Stop" :
"Start");
};
timer1.interval(100_ms);
timer1.tick += [&](
object & sender,
const event_args &
e) {
};
client_size({230, 130});
}
private:
int counter = 0;
};
}
auto main()->int {
application::run(timer_example::form1 {});
}