• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
overlay window creation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Cocoa-dev Digest, Vol 2, Issue 1018
  • Next by Date: Re: Cocoa-dev Digest, Vol 2, Issue 1018
  • Previous by thread: Re: PyObjC on OS X on Intel
  • Next by thread: Core Data, saving XML store is OK, loading is not
  • Index(es):
    • Date
    • Thread