Expose and local eventloops
Expose and local eventloops
- Subject: Expose and local eventloops
- From: Michael Schmidt <email@hidden>
- Date: Sat, 29 Jan 2005 20:41:32 +0100
- Organization: AbsInt GmbH
Hi,
I'm using a local eventloop to track mouse events while the mouse button is
pressed. Within the loop I also display a small helper window to show and update
some information. E.g. my subclass of NSView calls this method when a mouseDown
event occurs:
- (void)localMouseLoop
{
// infowindow is a NSWindow subclass on NSFLoatingWindowLevel
// rejecting key and main status
[infoWindow orderFront: self];
while (1)
{
NSEvent *event = [[self window] nextEventMatchingMask:
NSLeftMouseUpMask|NSLeftMouseDraggedMask];
switch ([event type])
{
case NSLeftMouseUp:
goto end_loop;
break;
case NSLeftMouseDragged:
// update state and contents of info window
break;
default:
break;
}
}
end_loop:
[infoWindow orderOut: self];
}
Now I have the following problems:
- if I activate Expose via F9 during the local loop I can return to my application
with a released mouse button => I have to click and release the mouse to leave the
loop. This is ugly.
- if I switch to another app the main window of my app remains a main window, i.e.
it looks like I have two active applications.
Is it possible to make such things and remain compatible to Expose? It seems, that
there needs to be an Expose specific event to exit the loop. Or should I skip the
idea of a local event loop?. I'm thankful for any hint.
--
Michael Schmidt
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden