overlay window creation
overlay window creation
- Subject: overlay window creation
- From: Pierre CHATEL <email@hidden>
- Date: Sat, 2 Jul 2005 13:31:54 -0300
Hi List,
I need to create an overlay window before the window (which is
overlaid) is even displayed.
I tried to sublcass NSWindow with no luck:
If i create the overlay window in the orderFront: method, i can't
draw into the overlay-window, i'm not sure it's even created ! If i
use the exact same code but, this time, after window's complete
initialization it works... so it does not come from my overlay-
creation code.
I used GDB to step into my code, but nothings looks wrong.
What do you suggest ? How can i create an overlay-window *before* the
main window is displayed on-screen ?
Here is an extract of my code:
- (void)orderFront:(id)sender {
WindowRef window = [self windowRef];
WindowRef overlayWindow;
Rect wRect;
GetWindowPortBounds(window, &wRect);
QDLocalToGlobalRect( GetWindowPort(window), &wRect );
//correct the 22px titlebar offset (bug?)
wRect.top -= 22;
wRect.bottom -= 22;
OSStatus err = CreateOverlayWindow(&wRect, &overlayWindow);
[super orderFront:sender];
}
// Create an overlay window
OSStatus CreateOverlayWindow( Rect* inBounds, WindowRef*
outOverlayWindow )
{
UInt32 flags = kWindowHideOnSuspendAttribute;
OSStatus err = CreateNewWindow( kOverlayWindowClass, flags,
inBounds, outOverlayWindow );
require_noerr(err, CreateNewWindowFAILED);
// SetPortWindowPort( *outOverlayWindow );
ShowWindow( *outOverlayWindow );
CreateNewWindowFAILED:
return err;
}
_______________________________________________
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