Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting NSWindow windownumber ?




On Jan 16, 2007, at 3:55 PM, Finlay Dobbie wrote:

On 16/01/07, Jonathan Johnson <email@hidden> wrote:
For even more fun times of beating multiple dead horses, you can even
load these methods up dynamically and call into Objective-C from PEF
applications <evil grin>.

If you're still using PEF then you're beyond help. :o)

Well, technically it isn't me *using it*, but our users. REALbasic can compile an app that uses WebKit on 10.2.8 and higher that still works on Mac OS 8.6 as well. Of course, most are probably compiling Mach-O by now for Intel support, but two-three years ago (when I originally did the above), there were still quite a few OS 9 holdouts.


These days, it's getting harder and harder to avoid at least
some Obj-C in Carbon applications (WebKit, Core Image, etc only expose
an Obj-C API), and fearing that is irrational.

True. However, some of us still do need to compile in CW for legacy PEF support for a little bit longer.


However, even with the above code, it is
*infinitely* easier to simply write:

int WindowGetWindowNumber( WindowRef win )
{
        NSWindow *win = [NSWindow initWithWindowRef:win];
        int out = [win windowNumber];
        [win release];
        return out;
}

Except you can't *do* anything with a window number without relying on SPI, and there's SPI for getting a CGSWindowID from a WindowRef directly (without instantiating a special NSWindow hackhackhack for representing non-Cocoa windows).

Well, I didn't say anything about it being something interesting to do :) I actually missed the beginning of the conversation and was just trying to be helpful, not realizing the person I replied to actually answered it the first time around :)


-Jon

--
Jonathan Johnson
email@hidden
REAL Software, Inc.

REAL World 2007 Conference
May 9 - 11 in Austin, Texas
<http://www.realsoftware.com/realworld>

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >Getting NSWindow windownumber ? (From: Rosemary Quince <email@hidden>)
 >Re: Getting NSWindow windownumber ? (From: Tomas Zahradnicky <email@hidden>)
 >Re: Getting NSWindow windownumber ? (From: "Finlay Dobbie" <email@hidden>)
 >Re: Getting NSWindow windownumber ? (From: Tomas Zahradnicky <email@hidden>)
 >Re: Getting NSWindow windownumber ? (From: "Finlay Dobbie" <email@hidden>)
 >Re: Getting NSWindow windownumber ? (From: Tomas Zahradnicky <email@hidden>)
 >Re: Getting NSWindow windownumber ? (From: Jonathan Johnson <email@hidden>)
 >Re: Getting NSWindow windownumber ? (From: "Finlay Dobbie" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.