mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 14:50:38 +00:00
Source/NSEvent.m
Source/NSScroller.m git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13187 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
fd6db100ed
commit
4fa33c8a8c
3 changed files with 45 additions and 18 deletions
|
@ -293,21 +293,15 @@ static Class eventClass;
|
|||
@"this thread %x", GSCurrentThread()];
|
||||
|
||||
/*
|
||||
* If the delay time is 0 then register a timer immediately. Otherwise
|
||||
* register a timer with no repeat that when fired registers the real timer
|
||||
* Register a timer that will fire in delaySeconds.
|
||||
* This timer will fire the first event and register
|
||||
* a repeat timer that will send the following events
|
||||
*/
|
||||
if (!delaySeconds)
|
||||
timer = [NSTimer timerWithTimeInterval: periodSeconds
|
||||
target: self
|
||||
selector: @selector(_timerFired:)
|
||||
userInfo: nil
|
||||
repeats: YES];
|
||||
else
|
||||
timer = [NSTimer timerWithTimeInterval: delaySeconds
|
||||
target: self
|
||||
selector: @selector(_registerRealTimer:)
|
||||
userInfo: [NSNumber numberWithDouble: periodSeconds]
|
||||
repeats: NO];
|
||||
timer = [NSTimer timerWithTimeInterval: delaySeconds
|
||||
target: self
|
||||
selector: @selector(_registerRealTimer:)
|
||||
userInfo: [NSNumber numberWithDouble: periodSeconds]
|
||||
repeats: NO];
|
||||
|
||||
[[NSRunLoop currentRunLoop] addTimer: timer
|
||||
forMode: NSEventTrackingRunLoopMode];
|
||||
|
@ -343,6 +337,23 @@ static Class eventClass;
|
|||
NSMutableDictionary *dict = GSCurrentThreadDictionary();
|
||||
|
||||
NSDebugLog (@"_registerRealTimer: ");
|
||||
{
|
||||
NSTimeInterval timeInterval;
|
||||
NSEvent *periodicEvent;
|
||||
|
||||
timeInterval = [[NSDate date] timeIntervalSinceReferenceDate];
|
||||
periodicEvent = [self otherEventWithType: NSPeriodic
|
||||
location: NSZeroPoint
|
||||
modifierFlags: 0
|
||||
timestamp: timeInterval
|
||||
windowNumber: 0
|
||||
context: [NSApp context]
|
||||
subtype: 0
|
||||
data1: 0
|
||||
data2: 0];
|
||||
|
||||
[NSApp postEvent: periodicEvent atStart: NO];
|
||||
}
|
||||
|
||||
realTimer = [NSTimer timerWithTimeInterval: [[timer userInfo] doubleValue]
|
||||
target: self
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue