• 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: Option-click on my app hides the other app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Option-click on my app hides the other app


  • Subject: Re: Option-click on my app hides the other app
  • From: Ben Haller <email@hidden>
  • Date: Thu, 11 Aug 2005 09:11:07 -0700

On Aug 11, 2005, at 4:17 AM, Chase wrote:

...
that being said, ben, i would certainly try eric's suggestion. i've just finished reading up a little on kUtilityWindowClass, and it sounds like it might do the trick.


one caveat with this solution is that if you have questions about it, you may have a difficult time getting answers on either the carbon-dev list or the cocoa-dev list, since it's a little of both. it shouldn't be too tricky though. just remember to add the Carbon framework to your project and import <Carbon/Carbon.h> wherever necessary and you may have to read up on CreateNewWindow(). I believe it should look something like:

NSWindow * wincocoa;
WindowRef wincarbon = NULL;
Rect rect;
SetRect(&rect, 0, 0, 400, 400);
OSStatus problem = CreateNewWindow(kUtilityWindowClass, (attr1| attr2 /* |etc... */), &rect, &wincarbon);
if (!problem) {
wincocoa = [[NSWindow alloc] initWithWindowRef:wincarbon];
}
// from this point on, you just use your NSWindow instance like you normally would.


good luck.

Thanks Chase and thanks Eric for this interesting lead. Unfortunately I don't think it will work for me; my window is an NSWindow subclass, as I am overriding both sendEvent: and validateMenuItem:, and I don't think I could do without them. I tried just using my NSWindow subclass in the code snippet above, but got a runtime error: "initWithWindowRef: is not currently supported for NSWindow subclasses".
All is not lost, however; stay tuned.


Ben Haller
Stick Software

_______________________________________________
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


References: 
 >Option-click on my app hides the other app (From: Ben Haller <email@hidden>)
 >Re: Option-click on my app hides the other app (From: Steve Bird <email@hidden>)
 >Re: Option-click on my app hides the other app (From: Ben Haller <email@hidden>)
 >Re: Option-click on my app hides the other app (From: email@hidden)
 >Re: Option-click on my app hides the other app (From: Ben Haller <email@hidden>)
 >Re: Option-click on my app hides the other app (From: Ted Thibodeau Jr <email@hidden>)
 >[Moderator] Re: Option-click on my app hides the other app (From: mmalcolm crawford <email@hidden>)
 >Re: [Moderator] Re: Option-click on my app hides the other app (From: Chase <email@hidden>)

  • Prev by Date: Color used in Unified Title/Toolbar look?
  • Next by Date: Re: Option-click on my app hides the other app
  • Previous by thread: Re: [Moderator] Re: Option-click on my app hides the other app
  • Next by thread: Re: Option-click on my app hides the other app
  • Index(es):
    • Date
    • Thread