• 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
Re: Setting NSWindow to be transparent
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting NSWindow to be transparent


  • Subject: Re: Setting NSWindow to be transparent
  • From: Michael Starke <email@hidden>
  • Date: Sun, 16 Jun 2013 10:33:28 +0200

I'm using the same effect in my application.

The problem is, if you use this method, the window might not be there yet. Did you inspect if the window iVar is actually not nil?
The way I did it is using the windowDidLoad method and call

-(void)windowDidLoad {
	[super windowDidLoad]
	[splashWindow setAlphaValue:0.0];
}

Works find for me. Code is here: https://github.com/mstarke/MacPass/blob/master/MacPass/MPOverlayWindowController.m

-Michael

On 16.06.2013, at 10:22, Pax <email@hidden> wrote:

> I am trying to set NSWindow (borderless, with no controls) to be transparent before I display it (so that I can fade it onto the screen).  Unfortunately, I don't seem to be able to - it loads, visibly, then sets the opacity to 0 (resulting in the window flickering at full opacity, before disappearing and then fading into view.  Sure, it's a fast flick - but it's ugly, and not the effect that I'm looking for.  Does anyone have any idea how to set opacity to 0 before displaying the window?
>
> Before we have the discussion about splash screens by the way, I'd just like to say 'I agree - I hate them too'.  To justify my actions, this is because the app loads into the menu bar, not the dock, and so (in testing) I discovered that users thought it hadn't loaded at all.  So, on first load only (unless specifically requested otherwise in preferences) a splash is displayed informing the user that the app has loaded - and to look up to the menu bar, not down to the dock.
>
> - (id)initSplash
> {
>    if (self = [super initWithWindowNibName:@"SplashScreen"])
>    {
>        (void) [splashWindow window];
>        [splashWindow setAlphaValue:0.0];
>        return self;
>    }
>
>    return nil;
> }
>
> _______________________________________________
>
> 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


___m i c h a e l   s t a r k e____
       geschäftsführer
       HicknHack Software GmbH
       www.hicknhack-software.com

___k o n t a k t____
       +49 (170) 3686136
       email@hidden

___H i c k n H a c k   S o f t w a r e   G m b H____
       geschäftsführer - maik lathan | andreas reischuck | michael starke
       bayreuther straße 32
       01187 dresden
       amtsgericht dresden HRB 30351
       sitz - dresden


_______________________________________________

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


  • Follow-Ups:
    • Re: Setting NSWindow to be transparent
      • From: Pax <email@hidden>
    • Re: Setting NSWindow to be transparent
      • From: Michael Starke <email@hidden>
References: 
 >Setting NSWindow to be transparent (From: Pax <email@hidden>)

  • Prev by Date: Setting NSWindow to be transparent
  • Next by Date: Re: Setting NSWindow to be transparent
  • Previous by thread: Setting NSWindow to be transparent
  • Next by thread: Re: Setting NSWindow to be transparent
  • Index(es):
    • Date
    • Thread