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 ?



Because I didn't want to include m files in the project and wanted to show it is possible from C.

Tomas

On Jan 16, 2007, at 10:59 , Finlay Dobbie wrote:

Why are you doing this? You should not be calling objc_msgSend
yourself. Let the compiler generate the calls for you.

int GetNSWindowNumber(void *inNSWindow) {
    return [(NSWindow *)inNSWindow windowNumber];
}

-- Finlay

On 15/01/07, Tomas Zahradnicky <email@hidden> wrote:

Dear Rose,

you can get the window number this way. No need for private APIs:

#include <objc/objc.h>

int GetNSWindowNumber( void* inNSWindow )
{
 int number = -1;
 SEL sel = sel_registerName("windowNumber");

 if( sel )
 number = objc_msgSend( inNSWindow, sel );

 return number;
}

Cheers,

  Tomas Zahradnicky


On Jan 11, 2007, at 19:44 , Rosemary Quince wrote:


Is it possible to obtain the NSWindow windowNumber from Carbon? If so, how?
_______________________________________________
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/zahradnicky% 40kppm.cz


This email sent to email@hidden




_______________________________________________
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/finlay.dobbie% 40gmail.com


This email sent to email@hidden




_______________________________________________ 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>)



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.