Re: Option-click on my app hides the other app
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