cocoa: adding the system timer to the most common loop modes (thus it would fire if menu is openned or a modal dialog is up)

git-svn-id: trunk@61271 -
This commit is contained in:
dmitry 2019-05-22 14:13:37 +00:00
parent 01762d1065
commit 47e78c92f8

View File

@ -315,7 +315,10 @@ begin
timer:=NSTimer.timerWithTimeInterval_target_selector_userInfo_repeats(
Interval/1000, user, objcselector(user.timerEvent), user, True);
// adding timer to all "common" loop mode.
NSRunLoop.currentRunLoop.addTimer_forMode(timer, NSDefaultRunLoopMode);
NSRunLoop.currentRunLoop.addTimer_forMode(timer, NSModalPanelRunLoopMode);
NSRunLoop.currentRunLoop.addTimer_forMode(timer, NSEventTrackingRunLoopMode);
{user is retained (twice, because it's target), by the timer and }
{released (twice) on timer invalidation}