Dali::Timer TickSignal 函数

Dali::Timer TickSignal function

我想在 tizen 应用程序中使用定时器,我将每 10 秒收到一次信号。我做了一些挖掘,发现有函数 Dali::Timer::TickSignal() 但我对如何使用该函数感到困惑? 谁能帮忙举个简单的例子?

来自the page

TimerSignalType& Dali::Timer::TickSignal ( )

Signal emitted after specified time interval.

The return of the callback decides whether signal emission 
stops or continues. If the callback function returns false, emission will
 stop and if true, it will continue. This return value is ignored for 
one-shot events, which will always stop after the first execution.

Returns:
The signal to Connect() with
Since:
2.4, DALi version 1.0.0

您也可以在github.com中提出请求获取样品:https://github.com/search?q=TickSignal+tizen&type=Code&utf8=%E2%9C%93

非常简单,您只需添加控制器的回调函数即可:

static Timer timer = Dali::Timer::New(10000);
timer.Start();
timer.TickSignal().Connect(this, &YourController::callbackFunction);

and callback function like:

bool callbackFunction(){

    return true;
}