raze/libraries/ZWidget/include/zwidget/core/timer.h

27 lines
374 B
C
Raw Normal View History

2024-01-04 19:37:57 +00:00
#pragma once
#include <functional>
class Widget;
class Timer
{
public:
Timer(Widget* owner);
~Timer();
void Start(int timeoutMilliseconds, bool repeat = true);
void Stop();
std::function<void()> FuncExpired;
private:
Widget* OwnerObj = nullptr;
Timer* PrevTimerObj = nullptr;
Timer* NextTimerObj = nullptr;
void* TimerId = nullptr;
friend class Widget;
};