• 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
Transparent window not getting mouse down events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Transparent window not getting mouse down events


  • Subject: Transparent window not getting mouse down events
  • From: Marshall Houskeeper <email@hidden>
  • Date: Tue, 31 Jan 2012 15:59:07 -0500

I would like to create a transparent  window that spans all the screens and that handles mouse down events.   Below is the code that I use to create my transparent window.  The transparent window gets created and display successfully.  However, mouse down events are not directed to the window.  I can see where this feature is desirable. For example making a round window.   However, not in my case.

Is there a way that I can setup a transparent  window to receive mouse down events?

Note: I have found that if I set the window's background color alpha value to 0.05 or greater I will receive mouse down events.   However this little amount of alpha causes some color shift in the background image.

- (id)init
{
	NSRect rect = [[NSScreen mainScreen] frame];

	// get the union of all the screens
    for (NSScreen* s in [NSScreen screens])
      {
	 rect = NSUnionRect(rect,[s frame]);
      }

    self = [super initWithContentRect:rect styleMask:NSBorderlessWindowMask backing:NSBackingStoreRetained defer:YES];

    if (self)
      {
	    [self setBackgroundColor:[NSColor clearColor]];
	    [self setOpaque:NO];
      }

     return self;
}

_______________________________________________

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: Transparent window not getting mouse down events
      • From: Ron Fleckner <email@hidden>
  • Prev by Date: Re: Calling an Objective-C function from C++?
  • Next by Date: Re: Calling an Objective-C function from C++?
  • Previous by thread: Re: NSDateFormatter not working on iOS 5.
  • Next by thread: Re: Transparent window not getting mouse down events
  • Index(es):
    • Date
    • Thread