Re: Window position updates on demand?
Re: Window position updates on demand?
- Subject: Re: Window position updates on demand?
- From: kata <email@hidden>
- Date: Fri, 18 Dec 2015 10:59:10 +0900
In my case, my window has no title bar and no frame, I do dragging window by myself.
In the NSView in the window
- (void)mouseDown:(NSEvent*)event {
self.mouse = [event locationInWindow];
}
- (void)mouseDragged:(NSEvent *)event {
NSPoint location = [NSEvent mouseLocation];
location.x -= self.mouse.x;
location.y -= self.mouse.y;
[[self window] setFrameOrigin:location];
[self setNeedsDisplay:YES]; // Do something here
}
then I can do anything during dragging.
Yoshiaki Katayanagi
http://www.jizoh.jp/english.html
2015/12/18 9:32、Cem Karan <email@hidden> wrote:
> Hi all, I'm working on an application that has one primary window and multiple support windows. The support windows show auxiliary information for what is in the primary window, but not off to the side; they are more like color filters or X-ray glasses. You slide them over the primary, and they show their extra information. To get an idea of what I'm talking about, clone https://github.com/ckaran/glfw/tree/transparent_windows, (that's the 'transparent_windows' branch) build it, and run the example that corresponds to https://github.com/ckaran/glfw/blob/transparent_windows/examples/filters.c. You'll get 3 windows, red, green, and blue. As you drag the blue window over the red one, a triangle will be drawn on the blue window that is centered on the red window.
>
> All that works, but the problem is that I'm not getting window positions quickly enough; as long as a window is being dragged, it won't send out a notification about its position, which means all the windows get out of sync with one another. This is annoying. I traced it down to the OS X code by logging where the windows thought they were, so I know it really is Cocoa and not GLFW. I tried polling the position of the window, but that doesn't work (the polling is happening, but it prints the same position continuously until dragging stops). So, how do I get the window to update where it actually, truly is at the moment I ask it?
>
> Thanks,
> Cem Karan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden